On Tuesday 12 November 2002 15:05, conbud wrote:
> Hey,
> How would I insert $_SESSION['user'] and $_SESSION['pass']
>
> into this
> mysql_query("select count(*) AS numfound from admins where user='$user' AND
> pass='$pass'",$db);
>
> right now I have
> $_SESSION['user'] = $_POST['user']
> $_SESSION['pass'] = $_POST['pass']
>
> and I need to put $_SESSION['user'] where the $user is in the above
> statement and so one w/ $pass

You mean like this?

mysql_query("select count(*) AS numfound from admins where 
user='{$_SESSION['user']}' AND
pass='{$_SESSION['pass']}'",$db);

BTW, it is much better to assign your query to a variable, eg $qry, then do

 mysql_query($qry, $db) or die('Error in $qry ' . mysql_error());

That way if your query doesn't work you'll at least know why.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Perhaps the biggest disappointments were the ones you expected anyway.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to