MySQL Forums
Forum List  »  PHP

Re: mysql to mysqli
Posted by: Peter Brawley
Date: April 14, 2018 08:59AM

Change mysql_connect() to mysqli_connect(), notice the 4th param for mysqli_comnect() selects active database.

Making such calls without error trapping is bad practice. Add error trapping.

The function execute_query() will need access to the connection resource returned by the above call.

Deliberately suppressing error info from database calls, as in @mysql_query(...) in execute_query(), is also bad practice, fix that.

Detailed info is at the url Barry suggtested.

Options: ReplyQuote

Written By
April 03, 2018 11:00PM
Re: mysql to mysqli
April 14, 2018 08:59AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.