| 
 Posted by Janwillem Borleffs on 09/04/05 01:50 
windandwaves wrote: 
> What is the most efficient way to write such a function??? 
> 
 
function getdata($sql) { 
     $result = @mysql_query($sql) or die("Error: " . mysql_error()); 
     $ret = array(); 
 
     while($row = mysql_fetch_assoc($result)) { 
          $ret[] = $row; 
     } 
     mysql_free_result($result); 
     return $ret; 
} 
 
 
$sql = 'SELECT `ID`, `NAM` FROM HEP ORDER BY `ID`'; 
$data = getdata($sql) 
 
foreach ($data as $d) { 
    $content .= '<li><a href="test.php?i='.$d["ID"]....... 
} 
 
 
JW
 
  
Navigation:
[Reply to this message] 
 |