note 33654 added to function.mysql-num-rows
| From: | chrisclark at clarksparts dot com | Date: | Thu, 03 Jul 2003 05:22:32 +0000 |
| Subject: | note 33654 added to function.mysql-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51397@lists.php.net to get a copy of this message | ||
$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?
----
Manual Page -- http://www.php.net/manual/en/function.mysql-num-rows.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33654
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33654&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33654&report=yes