Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any idea why this won't run?

Status
Not open for further replies.

buzzt

Programmer
Oct 17, 2002
171
CA
I am trying to run the following from a PHP page:

$exthr = mysql_query("select extract(hour from '19:00')");
echo $extr;


It does not seem to work. I end up with

Resource id #4

Yet if I type:

select extract(hour from '19:00');

at the mysql command line, it does. Any idea why PHP is not running this?
 
mysql_query returns a handle that should be used when fetching the data with mysql_fetch_array or mysql_fetch_row. It does not return any data.
 
echo $extr[0]; ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top