List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:November 24 1999 8:51pm
Subject:Re: select now();
View as plain text  
At 2:13 PM -0600 11/24/99, <apocoliptica@stripped> wrote:
>when I do this I get what is expected:
>
>mysql> select now() + 0;
>+----------------+
>| now() + 0      |
>+----------------+
>| 19991124184547 |
>+----------------+
>1 row in set (0.00 sec)
>
>but when I do this in a script I don't get those similar results:
>
>$now="select now() +0";
>$current_time=mysql_query($now,$db);
>echo "$current_time";
>
>No matter what time it is, I get a "2" for a value.  What am I doing wrong?

Not reading the description of mysql_query() in the PHP manual.

mysql_query() returns a result set identifier, not the results of the
query.  You'll need to check it to make sure the query succeeded,
and if so, use one of the row-fetching functions to retrieve the result.

-- 
Paul DuBois, paul@stripped
Thread
select now();apocoliptica24 Nov
  • Re: select now();Paul DuBois24 Nov