Posted by windandwaves on 09/04/05 02:22
Janwillem Borleffs wrote:
> 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"].......
> }
Thank you SO MUCH.... Awesome
[Back to original message]
|