i need help in php
Posted: Tue Mar 25, 2003 2:17 am
this ids a part from a function
all is work all but the the return command why its not working
all the data is work and the array is been work in the function all but the command return $up;
why?
Code: Select all
$lk = mysql_connect($serv,$user,$pass) or die ('Unable to do connection to the data base');
mysql_select_db($dbnameї0] ,$lk);
$qur = 'SELECT * from News ORDER BY id DESC LIMIT 0, 6';
$res = mysql_query($qur) or die ("error on the db" . $err = mysql_error());
while ($row = mysql_fetch_array($res)) {
$day = $rowї'day'];
switch ($rowї'byhow']) {
case 'chef':
$imgї0] = 'images/chef.jpg';
$imgnum = 1;
break;
case 'forgun':
$imgї0] = 'images/forgun.jpg';
$imgnum = 1;
case 'c&f':
$imgї0] = 'images/chef.jpg';
$imgї1] = 'images/forgun.jpg';
$imgnum = 2;
break;
default:
$imgї0] = 'images/forgun.jpg';
$imgnum = 1;
}
$up = array( array (
'title' => $rowї'title'] ,
'day' => $day ,
'date' => $rowї'date'] ,
'time' => $rowї'time'] ,
'body' => $rowї'body'] ,
'by' => $rowї'byhow'] ,
'imgnum' => $imgnum ,
'imgpath1' => $imgї0] ,
'imgpath2' => $imgї1]
) );
print_r($up);
return $up;
}all the data is work and the array is been work in the function all but the command return $up;
why?