»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 02-04-2004, 01:58 PM   #1 (permalink)
Registered User
 
Agent_Embryo's Avatar
 
Join Date: Oct 2001
Location: Sweden
Posts: 1,260
Agent_Embryo is on a distinguished road
Send a message via ICQ to Agent_Embryo

I'm trying to figure out why this won't work...it's for a login system for the site I'm building...

[code]
$query = "select usrid, losen from tblUsers where usrid='$_POST[user]' and password='$_POST[pass]'" or die("Error in query");
$result = mysql_db_query($db, $query, $connection) or die("Error in query");
$myrow = mysql_fetch_array($result)

if ($myrow["usrid"] > 0) {
setcookie ("user", md5($myrow[usrid]));
setcookie ("pass", md5($myrow[losen]));
mysql_free_result($result);
header("Location: test2.php");
} else { $login_error= true; }
[/code

This is what generates the parse error...
Code:
if ($myrow["usrid"] > 0) {
Can someone help?

Agent_Embryo is offline   Reply With Quote
Old 02-04-2004, 02:29 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
are you sure you have a record?
Do a check to make sure that $result has a record before testing for a specific field.
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 02-04-2004, 05:19 PM   #3 (permalink)
Registered User
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Champaign, IL
Posts: 3,253
jkrohn is on a distinguished road
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
Quote:
are you sure you have a record?
Do a check to make sure that $result has a record before testing for a specific field.
If there was no result then mysql_fetch_array would throw an error. Evene if it *didn't* throw the error, PHP will just evaluate to NULL on a wrong index.

What exactly is the parse error.

Jkrohn
__________________
Jkrohn
jkrohn is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 10:42 AM.