When I call the following PHP script, $qry_1 doesn't work (No query # 1!).

<?php
set_time_limit(300);
$connection=mysql_connect("localhost","wagner","???") or die ("No 
connection!");
$db=mysql_select_db("sbwresearch",$connection) or die ("No database!");

$qry_1="select
first_name.con_inf,
...
zip.con_inf,
label.svy_149
from con_inf, svy_149 where con_inf.username=svy_149.username";
$result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
{
   $first_name=$row_1["first_name"];
   ...
   $zip=$row_1["zip"];
   $label=$row_1["label"];
   if ($label=="n")
   {
   $qry_2="insert into address_149
   (
   first_name,
   ...,
   zip)
   values (
   \"$first_name\",
   ...,
   \"$zip\"
   )";
   $result_2=mysql_query($qry_2,$connection);
   };
};

mysql_free_result($result_1);
mysql_close($connection);
echo "<b>DONE</b>";
flush();
exit;
?>

Thank you!

Anthony F. Rodriguez
([EMAIL PROTECTED])


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to