Warning: mysqli_num_rows() expects parameter 1 to be mysqli_

This is the place to post questions and comments about the FlexBanner component
muddauber
Posts: 14
Joined: Sat Apr 06, 2013 5:34 am

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_

Post by muddauber » Thu Jan 02, 2014 5:13 am

Any suggestion on recovering banners or loading a working versions would be appreciated.
upgraded to latest version of Flex Banners and the module crashed.

This is the error message on website:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in

and I get this when I try to access clients, links or location in backend.

500 - An error has occurred.
Unknown column 'a.state' in 'field list' SQL=SELECT a.clientid AS clientid,a.clientname as clientname, a.contactname as contactname, a.contactemail as contactemail, a.checked_out as checked_out, a.checked_out_time AS checked_out_time, a.state AS state,uc.name AS editor FROM `j25_flexbannersclient` AS a LEFT JOIN j25_users AS uc ON uc.id=a.checked_out WHERE (a.state IN (0, 1)) GROUP BY a.clientid, a.clientname, a.contactname, a.contactemail, a.checked_out, a.checked_out_time, a.state, editor ORDER BY a.clientname asc Unknown column 'a.state' in 'field list' SQL=SELECT a.clientid AS clientid,a.clientname as clientname, a.contactname as contactname, a.contactemail as contactemail, a.checked_out as checked_out, a.checked_out_time AS checked_out_time, a.state AS state,uc.name AS editor FROM `j25_flexbannersclient` AS a LEFT JOIN j25_users AS uc ON uc.id=a.checked_out WHERE (a.state IN (0, 1)) GROUP BY a.clientid, a.clientname, a.contactname, a.contactemail, a.checked_out, a.checked_out_time, a.state, editor ORDER BY a.clientname asc LIMIT 0, 20 Unknown column 'a.state' in 'field list' SQL=SELECT a.clientid AS clientid,a.clientname as clientname, a.contactname as contactname, a.contactemail as contactemail, a.checked_out as checked_out, a.checked_out_time AS checked_out_time, a.state AS state,uc.name AS editor FROM `j25_flexbannersclient` AS a LEFT JOIN j25_users AS uc ON uc.id=a.checked_out WHERE (a.state IN (0, 1)) GROUP BY a.clientid, a.clientname, a.contactname, a.contactemail, a.checked_out, a.checked_out_time, a.state, editor ORDER BY a.clientname asc

Andrew998
Posts: 1400
Joined: Wed Jan 07, 2009 10:43 am

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by Andrew998 » Thu Jan 02, 2014 9:04 am

The upgrade hasn't gone through all the necessary steps and the database hasn't upgraded. Which version were you using before the upgrade, 2 or 3?
Andrew998
Developer

doorknob
Posts: 22
Joined: Mon Dec 30, 2013 12:34 pm

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by doorknob » Thu Jan 02, 2014 12:39 pm

Thanks for your response Andrew.
I sketched out the changes that I thought I would need to make and installed v4.0.3. I then set up a few records to examine whether my proposed changes were feasible and I found a few problems.
1 php error 'Notice: Undefined property: stdClass::$sizeid in \administrator\components\com_flexbanners\views\locations\tmpl\default.php on line 161 '
#__flexbannerslocations does not have a column 'sizeid'.
I removed line 161 to fix the problem.
2 Same thing in com_flexbanners\views\clients\tmpl\default.php on line 167
3 Same thing in com_flexbanners\views\links\tmpl\default.php on line 159
4 I tried to create a new banner. I entered some data and clicked the 'save & close' button. Some of the data was invalid. The errors were reported but instead of the program returning control to the edit screen for the errors to be corrected, it returned to the banner list page.
5 I returned to the new banner page and this time pressed the 'save' button. Again the errors were reported but none of the previously entered values were restored so every value had to be re-entered.
6 The dropdown lists all default to the first value rather than have an initial 'select a value' type entry. This gives completely random default value and generally considered bad practice.
7 The alt value is mandatory. I would always require this to be an empty string, a simple enough change to the xml file but I don't understand why you made it a required field.
All in all very disappointing so I'll look elsewhere

Andrew998
Posts: 1400
Joined: Wed Jan 07, 2009 10:43 am

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by Andrew998 » Thu Jan 02, 2014 12:42 pm

The problem is that the database is not up to date, not that the component or module are wrong. I need to know what version you updated from so that I can suggest which version to install to correct the database.
Andrew998
Developer

doorknob
Posts: 22
Joined: Mon Dec 30, 2013 12:34 pm

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by doorknob » Thu Jan 02, 2014 1:12 pm

I installed v4.0.3 into a J3.2.1 site

Andrew998
Posts: 1400
Joined: Wed Jan 07, 2009 10:43 am

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by Andrew998 » Thu Jan 02, 2014 1:14 pm

From scratch or as an upgrade?
Andrew998
Developer

doorknob
Posts: 22
Joined: Mon Dec 30, 2013 12:34 pm

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by doorknob » Thu Jan 02, 2014 1:24 pm

Not quite sure what you mean.
J3.2.1 was an upgrade from 3.2.0 which in turn was an upgrade from 3.1.16
FB was installed from scratch

Andrew998
Posts: 1400
Joined: Wed Jan 07, 2009 10:43 am

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by Andrew998 » Thu Jan 02, 2014 1:26 pm

Can you try installing v4.0.0 followed by the attached update please.
Attachments
com_flexbanners_update2.zip
(278.23 KiB) Downloaded 152 times
com_flexbanners_4.0.0.zip
(269.43 KiB) Downloaded 165 times
Andrew998
Developer

doorknob
Posts: 22
Joined: Mon Dec 30, 2013 12:34 pm

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by doorknob » Thu Jan 02, 2014 1:38 pm

install v 4.0.0 as an update or uninstall 4.0.3 first?

Andrew998
Posts: 1400
Joined: Wed Jan 07, 2009 10:43 am

Re: Warning: mysqli_num_rows() expects parameter 1 to be mys

Post by Andrew998 » Thu Jan 02, 2014 1:40 pm

No need to uninstall 4.0.3.
Andrew998
Developer

Post Reply