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
Post a Comment