Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:45:25+00:00 2026-05-27T14:45:25+00:00

I have the following update: $conn->query_cust(update cms_users set last_login_date = now() where id =

  • 0

I have the following update:

$conn->query_cust("update cms_users set last_login_date = now() where id = " . $_SESSION['USER_INFO']->id);

I’m sure the problem is not in the query_cust function because I use the same function in a few other forms and they work well. Anyway, here is the definition (with two var_dumps for debug-info):

function query_cust($s='',$rows=false,$organize=true) {
    var_dump($s);
    if (!$q=mysql_query($s,$this->con)) return false;
    if ($rows!==false) $rows = intval($rows);
    $rez=array(); $count=0;
    $type = $organize ? MYSQL_NUM : MYSQL_ASSOC;
    var_dump($q);
    while (($rows===false || $count<$rows) && $line=mysql_fetch_array($q,$type)) {
        if ($organize) {
            foreach ($line as $field_id => $value) {
                $table = mysql_field_table($q, $field_id);
                if ($table==='') $table=0;
                $field = mysql_field_name($q,$field_id);
                $rez[$count][$table][$field]=$value;
            }
        } else {
            $rez[$count] = $line;
        }
        ++$count;
    }
    if (!mysql_free_result($q)) return false;
    return $rez;
}

When executed, I get a Warning message saying:

string(57) "update cms_users set last_login_date = now() where id = 1" bool(true)
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/XX/XXXXXXX/html/core/mysql.php on line 26

What worries me is that it returns bool(true) but with (correct me if I’m wrong) a not ignorable warning !? When I copy the update-query manually into for example PHPmyAdmin it works (the user has table update/insert rights).

Just a few info for anyone having the same problem: Locally the code run’s without any problems (even with ‘error_reporting = E_ALL’ enabled), but when executed on the test environment (Godaddy’s hosting) the warning shows up.

PS: I’m not so into PHP (I’m from JAVA world) so please have mercy while posting your answers and my stupid sub-questions 🙂 Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:45:26+00:00Added an answer on May 27, 2026 at 2:45 pm

    Per the documentation, mysql_query returns true if the query does not return a resultset. Change:

    if (!$q=mysql_query($s,$this->con)) return false;
    

    to:

    if (!is_resource($q=mysql_query($s,$this->con))) return $q;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: UPDATE myTable SET Col1 = @Value However, I have
I have an SQL query that takes the following form: UPDATE foo SET flag=true
I have the following javascript code, which loads without error, however the update function
i have the following code to update a google map: function updateit(c1,c2){ alert(c1+-+c2); //
I have the following string: public static final String UPDATESONG = update songs SET
I have the following UPDATE scenario: UPDATE destTable d SET d.test_count = ( SELECT
I have following SQL UPDATE query: UPDATE Invoices SET Price = (SELECT SUM(Price*ProductsAndServices.Amount) FROM
I have the following query: UPDATE #Temp_SessionItem SET [Status] = CASE WHEN ([AddressFK] IS
I have the following UPDATE statement: update mytable set a = first_part(genid()), b =
I have the following update statement: update db1.dbo.table1 set db1.dbo.table1.col = db1_bk.dbo.table1.col where db1.dbo.table1.id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.