Help w/ "join" syntax

From: Date: Mon, 11 Mar 2002 12:43:44 +0000
Subject: Help w/ "join" syntax
Groups: php.general 
Request: Send a blank email to php-general+get-88001@lists.php.net to get a copy of this message
When I call the following 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; ?> Thanks! Anthony F. Rodriguez (afrodriguez@att.net)

« previous php.general (#88001) next »