Possible Duplicate:
PHP (MySQL) error : “Warning: mysql_num_rows() expects parameter 1 to be resource”
I'm trying to get this php page of an AJAX function to work.
Here is the error message when I try to run it:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/ftpbpan/public_html/ThornAJAX/info.php on line 10
Line 10 being:
**$num_rows = mysql_num_rows($query);**
<?php
$connect = mysql_connect("localhost","****","******") or die("didnot connect to database");
mysql_select_db("people");
if(strlen($_GET['user']) >0){
$name = $_GET['user'];
$query = mysql_query("select * from info where name='$name' limit 1");
$num_rows = mysql_num_rows($query);
if($num_rows == 1) {
$row = mysql_fetch_assoc($query);