MySQL Forums
Forum List  »  PHP

Format Date and Time
Posted by: Lee Marsden
Date: July 17, 2009 08:44AM

Hi All,

I am very new to using php and am working on a site for a band that want to be able to update there own information. I have created most of the backend using dreamweaver to generate some of the php code I require and I have also created the dateabase and tables. Everything is working OK except when I want to format the date and time on a details page.

I have one page that displays only certain information and you can click on an entry to go to a details page displaying all the information.

On the master page the select statement to produce the information works fine but on the details page once run I get this message

Warning: sprintf() [function.sprintf]: Too few arguments in C:\wamp\www\Lycan\gigsdetail.php on line 40
Query was empty

The php and sql select statement are below, If I just run this as a select * it works fine but trying to format the date and time gives the above error message

mysql_select_db($database_LycanOnlinedb, $LycanOnlinedb);
$query_DetailRS1 = sprintf("SELECT gigsid, location, date_FORMAT(date, '%e %M, %Y') as date, TIME_FORMAT(time, '%H:%i') as time, price, details FROM gigs WHERE gigsid = %s", GetSQLValueString($colname_DetailRS1, "int"));
$DetailRS1 = mysql_query($query_DetailRS1, $LycanOnlinedb) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);

I have searched all over but cannot find the solution.

Any help much appreciated

Thanks
Lee

Options: ReplyQuote


Subject
Written By
Posted
Format Date and Time
July 17, 2009 08:44AM
July 18, 2009 11:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.