Wrox Programmer Forums
|
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2010, 11:47 AM
uff uff is offline
Registered User
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default function mysql_format_date unknown?

Hi, i've found very useful this book, but it's so full of mistakes....
in the chapter 10 blog/news in the post_admin.php file there is a call to a function mysql_format_date that it's unknown in the help system of php site!
what can i do?
thank's to all for tha help
bye
Giorgio
 
Old October 12th, 2010, 08:41 PM
Authorized User
 
Join Date: Jul 2009
Posts: 77
Thanks: 4
Thanked 6 Times in 6 Posts
Default

Hi Giorgio,

mysql_format_date is not a PHP MySQL function.
It is a function the author defined in the
file lib/functions.php

If you go to the download code and look at
lib/functions.php, you can see he has defined
it there.

It looks like this.
PHP Code:
// accept mm/dd/yy date string and convert to mysql format
function mysql_format_date($date)
{
    list(
$month$day$year) = explode('/'$date);
    return 
sprintf('%04d-%02d-%02d'$year$month$day);

You can add it to your lib/functions.php file and this
should get you around this problem.


BE VERY CAREFUL about downloading the file
lib/functions.php because you already have
a file named lib/functions.php and you don't
want to overwrite it. I like the
idea of just pasting mysql_format_date function
onto the end of your existing lib/functions.php file.


In my opinion, the book should not have named
this function with a name that looks a lot
like a PHP MySQL function. This leads people
to believe it is a PHP MySQL function. Also, the book
did not mention this function in the text.
The only way you would know about it is to
look in the download code.

I hope this helps.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown runtime error abhishekkashyap27 C# 2005 6 April 8th, 2008 04:43 AM
Unknown Error!!!! arun_sunmic Pro Java 2 July 25th, 2006 11:24 PM
Unknown Gaz LG Danha Pro VB Databases 0 October 27th, 2004 02:21 AM
Unknown reason arnab2410 Pro VB Databases 0 February 9th, 2004 05:09 AM
Unknown function name khun Access VBA 4 October 23rd, 2003 05:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.