php - Call an SQL query record with foreach -


i want call record sql:

$up_recs = $db->get_results("select rid,note notes");  if ($up_recs > null)     {      foreach($up_recs $rec)         {            echo $rec['note']."<br/>";                   }      }  

and have error:

object of class stdclass not converted string

????

use

echo $rec->note."<br/>"; 

instead of

echo $rec['note']."<br/>"; 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -