Re: Help w/ "join" syntax
| From: | David Robley | Date: | Tue, 12 Mar 2002 00:12:48 +0000 |
| Subject: | Re: Help w/ "join" syntax | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88117@lists.php.net to get a copy of this message | ||
In article <4.3.2.7.2.20020311073636.00a9bc30@mailbox.bellatlantic.net>,
sbwi@bellatlantic.net says...
> 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!");
change to
$result_1=mysql_query($qry_1,$connection) or die ("No query # 1! Error: "
. mysql_error() );
mysql_error will give you a useful error message which should help you to
diagnose your problem.
I would guess that one problem is that you are using fieldname.tablename
in your query where you should be using tablename.fieldname
--
David Robley
Temporary Kiwi!
Quod subigo farinam