Re: Help w/ $_SESSION

From: Date: Tue, 12 Nov 2002 07:37:49 +0000
Subject: Re: Help w/ $_SESSION
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123942@lists.php.net to get a copy of this message
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. */

« previous php.general (#123942) next »