mysql_fetch_array +MySQL ...confused on how it works
Posted: Thu Mar 15, 2007 11:46 am
Hey everyone, I have a question about how mysql_fetch_array...
My PHP code looks like this:
$query = "my query here";
$result = mysql_query($query);
$row = mysql_fetch_array($result,MYSQL_NUM);
I ran a MySQL query through the client and it returns this (which is how I want it):
Where date and name are the two columns.
Now, how would I reference these values after using mysql_fetch_array()? I tried
echo $row[0]. " " .$row[1]; but it doesn't output anything.
So I would I output the array?
Thanks
My PHP code looks like this:
$query = "my query here";
$result = mysql_query($query);
$row = mysql_fetch_array($result,MYSQL_NUM);
I ran a MySQL query through the client and it returns this (which is how I want it):
Code: Select all
+------------------------+-----------------------------+
| date | name |
+------------------------+-----------------------------+
| Wednesday | Bill |
| Wednesday | Bob |
| Thursday | Joe |
+------------------------+-----------------------------+Now, how would I reference these values after using mysql_fetch_array()? I tried
echo $row[0]. " " .$row[1]; but it doesn't output anything.
So I would I output the array?
Thanks