If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

How to fix mysqli warning and error

I have a query which was correct in terms of the statements as this was tested in MYSQL. But when trying to switch from mysql to use mysqli, I can't seem the get the results to appear after a successful search.

I am getting 2 errors though which are these:

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'Array' was given in ... on line 78

Fatal error: Call to a member function execute() on a non-object in ... on line 79

I don't understand why I am getting the warning though because I am calling on an array so I don't know why the warning appears. I am guessing the fatal error would go i the warning goes but I am not sure.

I have changed my code back to the original SQL where I know the SQL is correct as it worked in the old mysql code. But since I tried changing the code to mysqli, it does not display a successful search for a correct term entered in the search box, instead it keeps stating it cannot find the term. Like I said my SQL is definitely correct but what am I doing wrong in mysql that is not allowing a successful search to occur? Is it something wrong with the num_rows() or stmt-fetch()?