Re: clause

From: Date: Mon, 27 Aug 2001 19:17:03 +0000
Subject: Re: clause
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-64680@lists.php.net to get a copy of this message
I don't know if this will help but why not to try $sql = "SELECT distinct users.uid , users.username FROM users LEFT JOIN picks USING(uid) WHERE picks.users_uid <> users.uid Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% ----- Original Message ----- From: "Jeremy Morano" <jeremy@prepresshelp.com> To: <php-general@lists.php.net> Sent: Monday, August 27, 2001 9:52 PM Subject: [PHP] clause > Hi, > > Can somebody help me out? > My where clause is completely being ignored. > More specifically the <>. I tried to use != and that didn't work either. > However, when I substitute it with an = , It fuctions correctly. > > Right now, the output is all the users.uid and all the users.username from > the table users. > H E L P ! > > > > $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, picks > WHERE picks.users_uid <> users.uid > "; > > $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); > > > while ($row = mysql_fetch_array($result)) { > $uid = $row['uid']; > $username = $row['username']; > > $option_block .= "<option value=\"$uid\">$username</option>"; > } > > > -- > 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 > >

« previous php.general (#64680) next »