And let’s store it all in session! What’s more, if there’s a database error, let’s go ahead and let the users know about it with echo! Brilliant!
1234567891011121314151617181920212223242526
<?phpclassBestCmsContentClassEvar{protectedfunctionget_content(){$sql='select * from content order by id;';$result=$this->run_query($sql);//echo('looking for content');$i=0;while($row=mysql_fetch_array($result,MYSQL_ASSOC)){if($row['location']=='inc'){$_SESSION['content_name'][$i]=$row['name'];$_SESSION['content_title'][$i]=$row['title'];$_SESSION['content'][$i]='inc';}else{$_SESSION['content_name'][$i]=$row['name'];$_SESSION['content_title'][$i]=$row['title'];$_SESSION['content'][$i]=$row['content'];}$i++;}echo(mysql_error());mysql_close();}}
UPDATE: Thanks to @Rob_OEM for the image below. It gave me the lulz.