...

View Full Version : PHP Error..Help



runeleader
02-19-2006, 10:55 PM
I get this error when trying to run a script any help?
I understand this is mysql internal error, but it shows it on my *.php

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/runelead/public_html/crospace/functions.php on line 42

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/runelead/public_html/crospace/functions.php on line 50

Warning: Cannot modify header information - headers already sent by (output started at /home/runelead/public_html/crospace/functions.php:42) in /home/runelead/public_html/crospace/index.php on line 73

Jak-S
02-19-2006, 11:13 PM
Its because the SQL query you sent isnt valid, and so $result isnt a valid result set. When you run mysql_num_rows its throwing this error because it cant count how many rows there are in an invalid result set.

Whats the SQL query?

runeleader
02-19-2006, 11:19 PM
function sql_rows($id,$table){
global $conn_id;
$query="select $id from $table";
$result=mysql_query($query,$conn_id);
$number=mysql_num_rows($result);
return $number;
}

function sql_close(){
global $conn_id;
mysql_close($conn_id);
then

$sql="select * from banners where b_blk='N' and b_typ='H' and b_exp='N'";
$res=mysql_query($sql);
$dis=array();
$dis_id=array();
$num=mysql_num_rows($res);
if(mysql_num_rows($res)) {

Jak-S
02-19-2006, 11:34 PM
Well, i dont see anything wrong with the syntax, stick this line ater the lines with mysql_query(...) on, it will output the error that mysql sends back, should tell you whats wrong with the query:


echo mysql_error();



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum