Ref id in php/mysql

Hi I have a table with id auto increment , I have another field is ref_id, i want to add same numeric data in this field for every 5 row & after every 5 row it will auto crease the no#.
Is this possible, if yes how can I do this?

Here below , what I want to do?

Mysql-table

id—ref_id
1----55
2----55
3----55
4----55
5----55
6----56
7----56
8----56
9----56
10----56

What exactly are you trying to achieve? And yes it is possible. Every five inserts you increase the ref ID. But I have a feeling there is something shady going on here.

How to do that, please explain.

Its a bit complicated. Please see below, i’m trying to explain.
I’m getting some data from a xls file…from the file i’m getting column DEFG data under one field QTY in mysql table.
https://www.sitepoint.com/community/t/php-excel-reader-issue/276568

https://stackoverflow.com/questions/46432063/getting-excel-row-data-to-mysql-column-in-php/46463308#46463308

Now I need to retrieve the data from mysql table to show in a html table as it is in the excel file. I mean like D-F-E-G column. I hope you got my point.

There is no point in having a dedicated field if its value can be easily calculated from another fields value

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.