Re: mysql query not working

Thanks for the help, That did the trick.
It is similar to what I had at first but the way I did it I kept getting
a too many arguments warning.  Also, I was passing in just the database
name instead of the $con.
Thanks again 
BlueScale
On Thu, 2008-08-07 at 11:58 +0530, Niran wrote:
> Yes I think you are not executing the query.
> Change it to:
> $sql = "SELECT * FROM members WHERE email_address = '" .
> $_SESSION["email"] . "' AND pass_word = '" . $_SESSION["psswd"] . "'";
> $res = mysql_query( $sql , $con);
> $row = mysql_fetch_assoc($res);
> 
> Here, $con is the database connection which should be opened before
> calling the mysql_query().
> And the mysql_fetch_assoc() accepts the result returned by the
> mysql_query() not the sql statement.
>  
> Visit php.net it contains the references for all the php functions.
> You can also download a chm file containing the off line version of
> the documentation.
> HTH
> Nirandas
> Website: http://www.nirandas.com
>         ----- Original Message ----- 
>         From: BlueScale 
>         To: programmingblind@xxxxxxxxxxxxx 
>         Sent: Thursday, August 07, 2008 11:33 AM
>         Subject: mysql query not working
>         
>         
>         
>         Hi,
>         I keep not getting what I am expecting.  I enter data I know
>         is in the database and still get an error.  Can someone tell
>         me if there is something wrong with this bit of code?
>         $sql = "SELECT * FROM members WHERE email_address = '" .
>         $_SESSION["email"] . "' AND pass_word = '" .
>         $_SESSION["psswd"] . "'";
>         $row = mysql_fetch_assoc($sql);
>         Thanks
>         BlueScale 

Other related posts: