Hi Ho,
I have a table stored on a database and I'd like to be able to retrieve some information from certain columns using PHP.
The columns I am interested in are called "name" "date" and "location".
Now, when retrieving the information from the columns I would like to use an inbuilt MySQL function to format the data into a more user friendly format. In this case it just so happens that I am interested in using the function for converting datetime columns into Unix Timestamps.
So, I can go into the MySQL monitor on my computer and enter the command;
"select UNIX_TIMESTAMP(date), name, location from thetable"
This function works perfectly well when I'm in the MySQL monitor (punching commands directly into MySQL). HOWEVER, when I use PHP to try and retrieve the results I'm having major problems with the date.
I'm using the standard PHP retrieval lines such as...
while ($row=mysql_fetch_array($result)) {
extract($row);
print "$name<br>";
print "$date<br>";
print "$location<br>";
}
But, the trouble is every time I try this on PHP, the date variables are totally empty! It's as if using the MySQL function has changed the variable name for date.
Can anyone help with this?