help in php
Posted: Fri Mar 21, 2003 5:09 pm
this code have a prob
the prob is that the var $display is all the time null onm the db there is a data i guess that the query is on error but not error that display on the page
i need to ask u guys wtf not good here any thing i try give me the $display null no data get in the the var why is that there is any errors on the code???
Code: Select all
function newsflash() {
$root = "./";
include ($root . "comm.inc");
$err = "";
$display = array ( );
include($root . $path['db'] .'dbs.' .$red);
$lk = mysql_connect($serv,$user,$pass) or die ('Unable to do connection to the data base');
mysql_select_db($dbname[0] ,$lk);
$qur = "SELECT id,flash FROM newsflash ORDER BY id DESC LIMIT 0, 3";
$res = mysql_query($qur) or die ("error on the db" . $err = mysql_error());
while ($row = mysql_fetch_array($res)) {
$display[] = $row['flash'];
}
return $display;
}i need to ask u guys wtf not good here any thing i try give me the $display null no data get in the the var why is that there is any errors on the code???