The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
mysql_num_rows() expects parameter 1 to be resource
Hello,
i'm using query like that $result = mysql_query("SELECT * FROM workshop_months_records where month_date LIKE '$month_date' limit 1"); $result_num_row = mysql_num_rows($result); and this error return to me Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in ..../includes/class_postbit.php(289) : eval()'d code on line 103 Although the plugin was work perfectly on version 3 waiting for help thanks |
#2
|
|||
|
|||
I guess that would happen if the query failed. Change the code to something like:
Code:
$result = mysql_query("SELECT * FROM workshop_months_records where month_date LIKE '$month_date' limit 1"); if ($result) { $result_num_row = mysql_num_rows($result); // etc } |
Благодарность от: | ||
tbworld |
#4
|
|||
|
|||
Yeah, you're right, I should have been more clear in saying that my "fix" is really only testing for FALSE to avoid the error, but doesn't fix the problem.
|
#5
|
|||
|
|||
the code work without problems in version 3 , and this error show white mysqli not mysql , so I expect that version 3 developed with mysqli , mysql_num_rows(); need $link parameter puls $result parameter , so i don't know how i can count the count of rows without the second parameter
--------------- Added [DATE]1401234837[/DATE] at [TIME]1401234837[/TIME] --------------- i will tray $result = mysql_query("SELECT COUNT(*) i hope it work |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|