Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /home/virtual/site17/fst/var/www/html/function.php on line 51
Warning: mysql_free_result(): supplied argument is not a valid MySQL result
resource in /home/virtual/site17/fst/var/www/html/function.php on line 52
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in /home/virtual/site17/fst/var/www/html/function.php on line 58
I get the above repeating errors when I aply the code below to the random
function:
49 srand ((double) microtime() * 1000000);
50 $r = mysql_query('select count(*) as cnt from agentdb');
51 $cnt = mysql_result($r, 0, 0);
52 mysql_free_result($r);
53 $rnd = rand(1, $cnt);
54 $sql = "SELECT * FROM agentdb WHERE ((OfficeID <> 214) and
(agentdb.agent_id<> 1115421) and(agentdb.agent_id > 100) and
agentdb.agent_id <> 333)) LIMIT $rnd, 1";
56
57 $results= mysql_query($sql);
58 $agent=mysql_fetch_array($results);
59 $agent_ref = $agent['agent_ref'];
60 $agent_id = $agent['agent_id'];
61 $agent_first = $agent['agent_first'];
62 $agent_last = $agent['agent_last'];
63 $agent_first = rawurldecode($agent_first);
64 $agent_last = rawurldecode($agent_last);
65 $aimage= "agentpics/".$agent_id.".jpg";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php