Jump to content
Latest News: (loading..)
tgely

mySqli usage after v2.3.3.2

Recommended Posts

Hi all,

 

I have collected here the most critical new mySqli usage and issues for addon edits recommendation.

 

1. Different return values from tep_db_query()

 

mysql return false or result

 

mysqli return result object or false

 

Would be better to control the result before do anything:

 

if (tep_db_num_rows("query string") > 0) {
  //than do something
}

 

Try avoid examination on result directly:

 

$result = tep_db_query("query string");
if ($result = 'something')

 

2. some construction problem may close the mysql connection so a similar error messages found:

 

PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given

 

possible issues

- non oscommerce standard redirection

 

Note: when PHP script is finished the database connection automatic closed.

 

3. hard coded mysql database PHP usage

After the updates hardly recommended to use mysqli core built in functions. PHP 5.4 store deprecated errors. mysql_query PHP functions will not be supported in PHP 5.5 version.

 

 

Other tips are welcome!

 

Best Regards,

Gergely


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×