Posted by Siv Hansen on 10/03/05 12:17
I'm not sure what you try to do, but if * in your query is eg. id and
name you can refer to them as id and name.
while($row=mysql_fetch_row($result)){
print $row['id]. " ".$row['name']."<br />\n"
//or put this in variables/arrays or what ever.
}
p cooper wrote:
> Sorry if this isnt the correct place- I cant find an obvious PHP/MySQL NG
>
> A 2 column table and i want row 1 to be the key and row 2 to be the value
> $result = mysql_query("SELECT * FROM table");
> while($row=mysql_fetch_row($result)){
>
> $array['$row[0]']=$row[1]
> }
> which doesnt work .
>
>
> im after the equivalent (in perl) of keys%array and values%array functions
Navigation:
[Reply to this message]
|