Re: Repeat : I'm Living in cookie hell....

From: Date: Sat, 12 May 2001 07:47:46 +0000
Subject: Re: Repeat : I'm Living in cookie hell....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52548@lists.php.net to get a copy of this message
Hello Scott, I took a look at your code, and have a solution for you. Here's the code: while ($row = mysql_fetch_array($result) ) { if ($row["memberid"] == $login_id) { // your code here :-) } } > > $row = mysql_fetch_array($result); // Get one row of data only *BAD* > if ($row[memberid] == $login_id) { > // [...] > } > > the path of the cookie to be the root under both instances, it should be > trying to set the same cookie, right? correct, but this only works if the first array returned is equal to the login_id. since you are returning only the first row of your database table, you never make it to the memberid that you're hoping is there -- assumming that it is there. Train harder! regards,barce

« previous php.general (#52548) next »