so I have this in my code.
$name = array('john','jane','mark');
$age = array(24,23,26);
$bio = array('about john','about jane','about mark');
and this is my table structure
id | name | age | bio
Now, my problem is I really don't know how can I able to insert the data in one row with same id using php and mysqli. can anyone have an idea about this?thanks in advance.
example output:
id | name | age | bio
1 | john | 24 | about john
1 | jane | 23 | about jane
1 | mark | 26 | about mark
thanks in advance.
Use an autoincrement column. MySQL updates autoincrement columns on insert.
For example:
id INT NOT NULL AUTO_INCREMENT
https://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
This is assuming you want a different id on each row.