mysql - Insert items into an SQL table using a loop in PHP (Fixed) -


$loopcounter = 0;             while ( $loopcounter < $amount ) {                 $sql = "insert bookings values (null, '$firstname', '$lastname', '$email', $enrolamount, '$location', $price)";                 $loopcounter += 1;                 mysqli_query( $dbc, $sql );             } 

so have loop try insert items sql table, when ever try inserts 1 item table. please help!

you have tinyint primary key has reached limit denoted by

auto_increment=127 in comment. per docs here maximum value tinyint 127.

you should run

alter table bookings change column bookings_id bookings_id unsigned int(10) not null auto_increment primary key;

and ok.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -