hi everyone.
last week I’ve started taken php lessons, but the teacher sucks
, and today he gave us a new php code but i didn’t understand it very well
so please can anyone explain it to me, with common language
public function get_all_records(){
$result=mysql_query("select news_id,news_tittel from news");
$arrdata[]=array();
while($row=mysql_fetch_array($result)){
$arrdata[]=$row;
}
return $arrdata;
}
Please be aware that the mysql_* extension is now deprecated as of the current version of PHP and will very likely be removed from the next 5.x version and will likely not be in PHP 6.x (when it eventually is released). You should migrate over to either the mysqli_* extension or to PDO. PDO is a better choice as it doesn’t tie you down so much to a particular database server software.