Jump to content

daft undefined variable issue


jarvis

Recommended Posts

Hi all,

 

Got the following code:

if (mysql_affected_rows() == 1) {
	echo "<div align=\"center\"><img src=\"images/account_active.gif\"></div>";
		$query1 = "SELECT email, pass FROM users WHERE (user_id=$x) LIMIT 1";
		$result1 = mysql_query ($query1) or trigger_error("Query: $query1\n<br />MySQL Error: " . mysql_error());
			$email = $row[0];
			$pw = $row[1];

When it runs, I get Undefined variable: row on line 44 which is $email = $row[0];

 

Please point out the obvious as to why and what I need to do. I can't think straight anymore

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/184184-daft-undefined-variable-issue/
Share on other sites

if (mysql_affected_rows(***NEED A LINK HERE !**) == 1) {
echo "<div align=\"center\"><img src=\"images/account_active.gif\"></div>";
$query1 = "SELECT email, pass FROM users WHERE (user_id=$x) LIMIT 1";
$result1 = mysql_query ($query1) or trigger_error("Query: $query1\n<br />MySQL Error: " . mysql_error());
while($row = mysql_fetch_assoc($result1)) {
$email = $row[0];
$pw = $row[1];
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.