I git this warning>>

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files (x86)\EasyPHP 2.0b1\www\HotelCalifornia\sites\reserve_room.php on line 85
Unknown column '' in 'where clause

This is my code>>




$db=mysql_connect("localhost" , $username, $password);
	mysql_select_db("hotel_cali", $db);

$sql="SELECT Email FROM customer WHERE username=\"$user\"";


$myrow=mysql_fetch_array($result) or die(mysql_error());;


How can i solve that?

Recommended Answers

All 2 Replies

$sql="SELECT Email FROM customer WHERE username='$user'";

the $result returneed from mysql is referein to an error or null niether that a result
set so the fetch function have invalid arguments and the solution is what Prof "pritaeas" is said as u have an error in ur mysql statement

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.