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
Post a Comment