Thread: mysql_query

Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default mysql_query

    Hi Guys,

    I'm not sure if this is a bug or not, but I've recently been trialling V1.5.2 Beta RC1 & RC2 and both are giving a problem with any modules that use mysql_query($variable) ;

    Example: The 'print' option in Super Orders

    [21-Dec-2013 07:48:43 UTC] PHP Warning: mysql_query(): Access denied for user 'rod'@'localhost' (using password: NO) in /home/www/XXXXXX/super_data_sheet.php on line 195
    [21-Dec-2013 07:48:43 UTC] PHP Stack trace:
    [21-Dec-2013 07:48:43 UTC] PHP 1. {main}() /home/www/XXXXXX/super_data_sheet.php:0
    [21-Dec-2013 07:48:43 UTC] PHP 2. mysql_query(*uninitialized*) /home/www/XXXXXX/super_data_sheet.php:195
    [21-Dec-2013 07:48:43 UTC] PHP Warning: mysql_query(): A link to the server could not be established in /home/www/XXXXXX/super_data_sheet.php on line 195
    [21-Dec-2013 07:48:43 UTC] PHP Stack trace:
    [21-Dec-2013 07:48:43 UTC] PHP 1. {main}() /home/www/XXXXXX/super_data_sheet.php:0
    [21-Dec-2013 07:48:43 UTC] PHP 2. mysql_query(*uninitialized*) /home/www/XXXXXX/super_data_sheet.php:195
    [21-Dec-2013 07:48:43 UTC] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/www/XXXXXX/super_data_sheet.php on line 196
    [21-Dec-2013 07:48:43 UTC] PHP Stack trace:
    [21-Dec-2013 07:48:43 UTC] PHP 1. {main}() /home/www/XXXXXX/super_data_sheet.php:0
    [21-Dec-2013 07:48:43 UTC] PHP 2. mysql_fetch_array(*uninitialized*, *uninitialized*) /home/www/XXXXXX/super_data_sheet.php:196

    ---------------------------------------------------------

    Cross Sell Advanced for v1.5.0

    [21-Dec-2013 08:07:18 UTC] PHP Warning: mysql_query() expects parameter 2 to be resource, object given in /home/www/XXXXXX/xsell.php on line 152
    [21-Dec-2013 08:07:18 UTC] PHP Stack trace:
    [21-Dec-2013 08:07:18 UTC] PHP 1. {main}() /home/www/XXXXXX/xsell.php:0
    [21-Dec-2013 08:07:18 UTC] PHP 2. mysql_query(*uninitialized*, *uninitialized*) /home/www/XXXXXX/xsell.php:152

    -----------------------------------------------------------------

    Any ideas for a solution?

    Cheers
    RodG

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,345
    Plugin Contributions
    94

    Default Re: mysql_query

    Could it be because v1.5.2 has converted to a mysqli instead of mysql interface?

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: mysql_query

    Quote Originally Posted by lat9 View Post
    Could it be because v1.5.2 has converted to a mysqli instead of mysql interface?
    Undoubtedly.

    I've fixed the problem with the mysql_query error (by replacing them with $db->execute

    I'm still having a problem with the mysql_fetch_array() commands though. I've tried changing these to mysqli_fetch_array() but they are still giving errors.

    Obviously I'm doing something wrong, but so far I still haven't figured out what.

    Any ideas?

    Cheers
    Rod

  4. #4
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: mysql_query

    isn't that done with the $db->Execute,

    If I remember well from porting modules from Osc,

    Qouted from http://www.zen-cart.com/wiki/index.p...dules_from_osC
    Replace code like


    $my_var_query = tep_db_query("query stuff"); $my_var = tep_db_fetch_array($my_var_query); by

    $my_var = $db->Execute("query stuff");
    So I guess it might work on ZC too

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: mysql_query

    Problem solved.

    -------- Original code example ------------------------
    $result = mysql_query($query) ;

    while ($datafields = mysql_fetch_array($result)) {

    /// code goes here

    }

    ----------------------------------

    -------- Modified code example --------------
    $result = $db->execute($query) ;

    while (!$result->EOF) {

    $datafields = $result->fields ;

    /// code goes here

    $result->MoveNext ;
    }

    ---------------------------------------------------

 

 

Similar Threads

  1. v151 $aaa = mysql_query($aaa_query) instead of while (!$aaa->EOF)
    By tips007 in forum General Questions
    Replies: 5
    Last Post: 6 May 2013, 05:45 AM
  2. mysql_query question.
    By cleverpork in forum General Questions
    Replies: 7
    Last Post: 23 Nov 2011, 05:55 AM
  3. [Not a Bug] initial page hanging in mysql_query -- Resolved!
    By Murf-in-Wyoming in forum Bug Reports
    Replies: 0
    Last Post: 18 Apr 2009, 08:16 PM
  4. mysql_query INSERT products, Question
    By HighJump in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 4 Nov 2008, 11:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR