Re: fix my query please

From: Date: Tue, 28 Aug 2001 20:46:25 +0000
Subject: Re: fix my query please
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65122@lists.php.net to get a copy of this message
Hello Jeremy, Two things: FROM users LEFT OUTER JOIN picks using(id) > Where users.uid <> picks.user_id 1- when you do OUTER join, you do NOT have to use the <>. That's what outher join means. 2- what is id? Is it a column? shouldn't it be uid? Maybe that's your problem. --- Jeremy Morano <jeremy@prepresshelp.com> wrote: > an somebody please fix up my query. > > > > > $connection = @mysql_connect("l", "c", "c") or > die("Couldn't connect."); > > $db = @mysql_select_db($db_name, $connection) or > die("Couldn't select > database."); > > > > $sql = "SELECT distinct users.uid , users.username > FROM users LEFT OUTER JOIN picks using(id) > Where users.uid <> picks.user_id > "; > > > > $result = @mysql_query($sql,$connection) or die("Couldn't > execute query."); > > > while ($row = mysql_fetch_array($result)) { > $usersleft = $row['username']; > $uid = $row['uid']; > > $my_string="$usersleft<br>"; > > echo $my_string; > } > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== Mehmet Erisen http://www.erisen.com __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

« previous php.general (#65122) next »