Works with one server and not the other
| From: | Christine Clerc | Date: | Mon, 24 Jun 2002 21:48:07 +0000 |
| Subject: | Works with one server and not the other | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20068@lists.php.net to get a copy of this message | ||
Hi,
I want to populate two related tables : here is the code
include ("connect.php");
$req="select * from tab where num='$mod'";
$result=mysql_query($req,$db);
if ($ligne=mysql_fetch_array($result))
//if the data is already there do nothing
{continue;}
//otherwise put it in table 1
$req2="INSERT INTO tab (num) VALUES ('$mod')";
$result2=mysql_query($req2,$db);
//and then add the relational element to table 2
$req4="INSERT INTO inter (id_tab) SELECT id_tab FROM tab WHERE num='$mod'";
$result4=mysql_query($req4, $db);
The first part works fine on both servers (table 1)
Table 2 fills up fine on my machine but not on the server wher it is supposed to go !
Any idea ?
Christine