note 33654 rejected from function.mysql-num-rows by didou

From: Date: Thu, 03 Jul 2003 08:12:31 +0000
Subject: note 33654 rejected from function.mysql-num-rows by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-51405@lists.php.net to get a copy of this message
Note Submitter: chrisclark@clarksparts.com ---- $link = mysql_connect('localhost', 'user_name', 'user_password') or die("Error: Could not connect to the Database Server"); mysql_select_db('pmd') or die("Error: Could not select the Database"); $usrid = $_COOKIE['id']; $sel_tick = 'Select * from tickets where usr_id=$usrid order by id DESC'; $result = mysql_query($sel_tick); $total_tickets = mysql_num_rows($result); $i=0; while($row = mysql_fetch_object($result)){ switch($row->status){ case 1: $status = "OPEN"; break; case 2: $status = "CLOSED"; break; default : $status = "ERR"; break; } $tickets['id'][$i] = $row->id; $tickets['status'][$i] = $row->status; $tickets['pri'][$i] = $row->pri; $tickets['subject'][$i] = $row->sub; $tickets['st'][$i] = $status; $tickets['log'][$i] = $row->logg; $i++; } I get these errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\opensa\apache\htdocs\customersupport\viewall.php on line 215 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in c:\opensa\apache\htdocs\customersupport\viewall.php on line 217 Can someone help?

« previous php.notes (#51405) next »