0
<?php

 $conn = mysql_connect("localhost", "sermail_demos", "demos")or die("sem conecчуo ao servidor");
    $db = mysql_select_db("sermail_sermail")or die("Base de dados nуo foi encontrada");

$b=1;
$c=2000;
$sql2a = 'INSERT INTO content_type_image ( vid, nid, field_stock_value) VALUES';
    for ($i=197; $i<2000; $i++) {
         $sql2a .= '('.$i.','.$i.','.$b.')';   } 

 mysql_query($sql2a) or die(mysql_error());
    echo $sql2a;


    ?>

i cant finf out why returns this error..
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(198,198,1)(199,199,1)(200,200,1)(201,201,1)(202,202,1)(203,203,1)(204,204,1)(20' at line 1

2
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by blocblue
0

No. The values for each row need to be separated with a comma.
E.g. (198,198,1), (199,199,1), ...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.