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!

Problem with Date and Time functions

Status
Not open for further replies.

Louth

Programmer
Jan 21, 2004
16
EU
I have been having problems using date and time functions in PHP. I am trying to design a schedule with a Calendar. I tried to use the following line of code to output the current month i.e. February. The line of code I have used is this :

$month = mysql_query("select monthname(curdate( ))");

I am getting the following output from this:

Resource id#6

Could somebody please explain why I am getting this output and are there alternative ways of getting the information I need
 
$query = mysql_query("select monthname(curdate( ))");
$month=mysql_result($query,0);


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Cheers man. I actually figured out another way of doing it using PHP's time function. Anyway do you know of anywhere I could find some code to implement a calendar in PHP. I'm trying to design one but there should be lots of freeware solutions around. Do you know of any good ones.
 
no m8, calendars seem a bit thin on the ground - search the PHP forum, there was some source kicking around in there which wasnt too bad.
PHP Forum : forum434 daa and time functions are very easy to use when you get your head around them, far easier than PHP's mktime ....


______________________________________________________________________
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