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 9221267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:32:29+00:00 2026-06-18T03:32:29+00:00

I keep getting an array to string conversion notice, it seems to be from

  • 0

I keep getting an array to string conversion notice, it seems to be from the way I have escaped (or haven’t escaped) the MySQL statement. If I do not use a PHP variable and put the data in as text it works, but with the variables it shows an error. Help! 🙂

function lastBackupStatus($server,$node){
  $serverstatus = "";
  $i=1;
  $result = mysql_query("select
    max(case when status LIKE '%Failed%' then scheduled_start end) Last_Failed,
    max(case when status LIKE '%Missed%' then scheduled_start end) Last_Missed,
    max(case when status LIKE '%Completed%' then scheduled_start end) Last_Completed,
    node_name,
    schedule_name
    from `events_".$server."`
    where node_name='".$node."'
    group by node_name, schedule_name
    ORDER BY last_failed");
  $count=mysql_num_rows($result);
  if ($count!== 0){
    while ($info = mysql_fetch_assoc( $result )){
      if($i < $count){
        $serverstatus .="";//do nothing
      }else{
        if($info['Last_Failed']  > $info['Last_Completed']){
          if($info['Last_Failed'] > $info['Last_Missed']){
            $serverstatus .="Failed:". $info['Last_Failed'].
              $info['node_name'].$info['schedule_name']."</br>";
          }
        }
        if($info['Last_Missed'] > $info['Last_Completed']){
          if ($info['Last_Missed'] > $info['Last_Failed']){
            $serverstatus .=" Missed: ". $info['Last_Failed'].
              $info['node_name'].$info['schedule_name']."</br>";
          }
        }
      }
      $i++;
    }
  } else {
    $serverstatus .= "count is 0";
  }
  return $serverstatus;
}
  • 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-06-18T03:32:30+00:00Added an answer on June 18, 2026 at 3:32 am

    You forgot the AS keyword:

    max(case when status LIKE '%Failed%' then scheduled_start end) Last_Failed, 
    max(case when status LIKE '%Missed%' then scheduled_start end) Last_Missed,
    max(case when status LIKE '%Completed%' then scheduled_start end) Last_Completed,
    

    should be

    max(case when status LIKE '%Failed%' then scheduled_start end) AS Last_Failed, 
    max(case when status LIKE '%Missed%' then scheduled_start end) AS Last_Missed,
    max(case when status LIKE '%Completed%' then scheduled_start end) AS Last_Completed,
    

    Therefore $info['Last_Failed'] had no associative index, etc.

    Per your comment, it appears $node was an array after all, and you need to replace this:

    where node_name='".$node."'
    

    with this:

    where node_name='".$node['node_name']."'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error: initializer-string for array of chars is too long Even
i keep getting this error for an array of errors that i have set
The Error I keep getting is: stripslashes() expects parameter 1 to be string, array
I keep getting this error but this sql statement works fine in mysql it
I keep getting this: [0] => Array ( [0] => Array ( [thread_id] =>
Keep getting the error Arguments are not sufficiently instantiated for the multiplication by addition
I keep getting an error saying that @android:style/Widget.Holo.Light.Button.Borderless is not public and so can't
I keep getting this error and have no idea why. I googled and scanned
I keep getting this error on emulator: I copied this from a tutorial and
I have an array: String[] ay = { blah, blah number 2 etc };

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.