Link to home
Start Free TrialLog in
Avatar of Ken Graser
Ken GraserFlag for United States of America

asked on

Need help converting mysql statement to mysqli statement

Our web server has just been updated to use PHP 5.8.  When this happened we started getting warning messages about mysql be depreciated and we should use mysqli.  I was able to get my database connector converted but I ran into another problem.

There is a routine on our sites with calculates the county sales tax on orders.  This was written by a third party who is not around any more.  Therefore I'm trying to modify his program and I have run into a problem.

I need to know how to rewrite this query:
$query = mysql_query($sSQL);

If I just change mysql to mysqli, I get an error message "mysqli_query() expects at least 2 parameters, 1 given".

I'm not sure what the other parameter should be.  

Any assistance would be appreciated.

Thanks
Ken
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I confirm the above.
you may want to read up the technical reference pages for such kind of questions:
php.net/mysqli_query
Avatar of Ken Graser

ASKER

Thanks Dan,

That is exactly what I needed.  Considering that I don't know mysql, you saved me a lot of time.

Ken
Glad I could help!