1 ===== Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:webroot\app\app\customer.php on line 627 2 ===== Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\webroot\app\app\customer.php on line 101 3 ===== Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\webroot\app\app\customer.php on line 248 4 ===== Undefined variable: currMin in C:\webroot\app\app\customer.php on line 670 I Post file that is uploaded i
so basicly this is one piece that causes an error: function fetch($que, $type = null) { if (!$type) { $assoc = mysql_fetch_assoc( $que ); return $assoc; } if ($type == 'array') { $arr = mysql_fetch_assoc( $que ); return $arr; } if ($type == 'row') { $row = mysql_fetch_row( $que ); return $row; } return false; } PHP: I don't know how much php you know. But what the PHP error is saying is that $que is a boolean. When you want to call this function somewhere you have to do fetch(parameter1, parameter2). It looks like that parameter1 is a boolean instead of resource. A resource could be something like this: $result = mysql_query("SELECT id,email FROM people WHERE id = '42'"); Code (markup): $result is a resource. So basically you should track what it puts in. We can't see much with this code...
Thanks for fast reply sir i see somewhere this error too in my php if ($type == 'row') { $row = mysql_fetch_row( $que ); return $row; } PHP: let me check and i am not very expert in PHP
You need to show us how you're using the PHP-class/functions in the code you pasted (as a text-file) above. Ie, what is being given to the functions, what does the $que-variable hold, etc. If you're using it wrong, it will throw errors, and since you're not providing the proper information, it's hard to know what is wrong. But my guess is that your query/result isn't returning what the function expects. Reposting the code you've already posted doesn't really help...
No. But somewhere, you're USING this class (the one you've shared with us) - HOW do you use this class? As far as I could see by a quick look, that's all one huge class, with a lot of functions tucked inside it - there might be nothing wrong with the class itself (probably isn't), but the way you're implementing it is not correct - as others have pointed out, the $que-parameter (for each of the errors you're getting), is a boolean (1:0 or true:false) instead of a proper query, or similar. This can, for instance, happen if you try to run a malformed query, or the query is doing some sort of comparison and returning either true or false depending on the output (bort of these won't work in the class you posted above). The point is, we've given you a lot of pointers - read up on the error-message you've gotten (paste it into google, just this bit: "mysql_num_rows() expects parameter 1 to be resource, boolean given") and read up on what the error means.
There are a lot of issues with that code, which looks to be circa the end of PHP 4's life cycle; most of it will be throwing errors and warnings like CRAZY under PHP 5.4/later it's that badly out of date. The long deprecated 'var' property, lack of scopes on methods... and that's before talking the just plain badly written nonsense like variables for nothing, nested IF doing case's job, etc, etc... ... and as PoPSiCLe is saying, we STILL aren't seeing enough of this to say what's wrong since we can't see what's calling this class and/or how it's being called. ... but if I was handed this code, I'd figure out what it's trying to do, and pitch it in the trash to start over from scratch as it's so poorly written and so badly out of date, it would take less time to rewrite from scratch than it would to try and fix.
i told u al that i am nto programmer i have downaod script from somewhere and i m getring this error if u guys want i can send u script full with back up if u really can fix this error then u can check what ever u ned there Thansk for helping
There is Some file which are related to This file which show up me error http://www.mediafire.com/download/85bmtukjn043knn/FILES.zip hope now maybe u guys get solution Regards ghulam
$stadtQue = $customer->query( 'SELECT html FROM static WHERE type=\'main\' LIMIT 1' ); That is probably the problem. Do you have a "static" table and a html column in there?
Yes i have table static and Column html but i dont undestand where should i use this line $stadtQue = $customer->query( 'SELECT html FROM static WHERE type=\'main\' LIMIT 1' ); PHP:
Could you please try that query into your database. Post what it trows out. I do think that that is causing the problem.