Web Analytics Made Easy -
StatCounter MySQL 5.5 to 5.6 compatibility issues - CodingForum


No announcement yet.

MySQL 5.5 to 5.6 compatibility issues

  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL 5.5 to 5.6 compatibility issues

    Following code not working with MySQL version 5.6.
    If you are familiar with these coding, please suggest me corrected code.
    You can copy entire code and add fixes.

    PHP Code:
    $temp mysql_query("SELECT id FROM ".C_MYSQL_TEMP." WHERE date < DATE_SUB(NOW(), INTERVAL ".C_REG_DAYS." DAY)");
    while (
    $i mysql_fetch_array($temp))
    $tmp mysql_query("SELECT pic1, pic2, pic3 FROM ".C_MYSQL_MEMBERS." WHERE id='".$i['id']."' and status = '0'");
      while (
    $j mysql_fetch_array($tmp))
    $k 1$k <= 3$k++) 
    $tmpm 'pic'.$k;
             if ((
    $j[$tmpm] != '') && (is_file(C_PATH.'/members/uploads/'.$j[$tmpm]))) 
    unlink (C_PATH.'/members/uploads/'.$j[$tmpm]);
    mysql_query("DELETE FROM ".C_MYSQL_MEMBERS." WHERE id='".$i['id']."' and status = '0'");
    mysql_query("DELETE FROM ".C_MYSQL_TEMP." WHERE id='".$i['id']."'");

    $temp=mysql_query("SELECT count(*) as total FROM ".C_MYSQL_TEMP." WHERE id='".$id."' AND code='".$code."' AND date > DATE_SUB(NOW(), INTERVAL ".C_REG_DAYS." DAY)");
    $count $row['total'];
    $count != '0') {
    mysql_query("DELETE FROM ".C_MYSQL_TEMP." WHERE id='".$id."' AND code='".$code."'");
    C_CHECK_REGISTER == '3') {
       else {
    mysql_query("UPDATE ".C_MYSQL_MEMBERS." SET status='".$status."' WHERE id='".$id."'");
    $result mysql_query('SELECT email, password FROM '.C_MYSQL_MEMBERS.' WHERE id = \''.$id.'\'');
    $i=mysql_fetch_array($result)) {
    switch (
    C_ID) {

    else {

  • #2
    Almost all of that code needs a complete rewrite as that database interface was obsolete even in PHP 5.5 (you were meant to start work on replacing it in July 2013 when PHP 5.5 was released if you hadn't already replaced it in the preceding 9 years.

    Also you are hiding errors with @ on the front of statements - something you should never do.

    As to what is specifically causing problems with PHP 5.6 I have no idea as I had stopped using all those antiquated calls by the time I upgraded to PHP 5.2
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


    • #3
      Ok thank you for the reply!


      • #4
        Remove the @.
        After every mysql_query add

        That should give you the error that happens.
        Don't use old mysql library
        The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets
        When a white horse is not a horse


        • #5
          Also, telling us that code doesn't work is pointless. We already know that since you are posting on a programming help forum.

          You have to describe or show exactly what it is doing and if it's not clear from the result what's wrong, you have to describe or show what the expected result should be.
          Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.