Jump to content

c500mg

New Members
  • Posts

    3
  • Joined

  • Last visited

c500mg's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I wanted to thank you guys for your help, I had 3 days trying to figure it out and finally found the error, there is no issues in the code it was only that i hace the connection line deleted for some reason!!! I just want to apologize for my terrible mistake... I am sorry but I did turned ON display_errors for php... thank you for that too!!
  2. Yes I also tried echo "<br>ERROR: $sql.".mysqli_error($connect);
  3. I was wondering if anyone could help me finding the error or why my script won't insert data into the table. $str = '123456,123457,123458,123459,234567,234568,234569'; $str_arr = explode (",", $str); echo '<br> $str_arr = '; print_r($str_arr); echo "<br><br><br>"; foreach ($str_arr as $value) { $sql = 'INSERT INTO parts (part_serial) VALUES ("'.$value.'")'; if(mysqli_query($connect, $sql)){ echo "record inserted successfully.<br>"; } else { echo "<br>ERROR: $sql."; print_r($connect->error); } } and i don't any error, if anyone could help me debug the code this is the output: $str_arr = Array ( [0] => 123456 [1] => 123457 [2] => 123458 [3] => 123459 [4] => 234567 [5] => 234568 [6] => 234569 ) ERROR: INSERT INTO parts (part_serial) VALUES ("123456"). ERROR: INSERT INTO parts (part_serial) VALUES ("123457"). ERROR: INSERT INTO parts (part_serial) VALUES ("123458"). ERROR: INSERT INTO parts (part_serial) VALUES ("123459"). ERROR: INSERT INTO parts (part_serial) VALUES ("234567"). ERROR: INSERT INTO parts (part_serial) VALUES ("234568"). ERROR: INSERT INTO parts (part_serial) VALUES ("234569"). and also recommend a software to write php for MacOS
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.