Posted by windandwaves on 09/04/05 02:49
windandwaves wrote:
> 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"].......
Does it slow things down to use proper names rather than numbers, i.e.
$d["NAM"] rather than $d[0]
Thank you again
- Nicolaas
[Back to original message]
|