Click here to get back home

inserting current date and time

 HomeNewsGroups | Search

mailing.database.mysql - MySQL database issues discussed in this best MySQL group in USENET 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
inserting current date and time toedipper 07-20-2005
Posted by toedipper on July 20, 2005, 11:36 pm
Please log in for more thread options
Hello,

I have the following section of php code which updates a mysql record
from a form. For the values of livedate and livetime I need to insert
the current_date() and current_time() respectively.

When I run the code however it falls over at the line with

GetSQLValueString(current_date(), "date")

The error is Fatal error: Call to undefined function: current_date()

any ideas?

Thanks,

td


if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "frmaddsw")) {
$updateSQL = sprintf("UPDATE software SET title=%s, shortdesc=%s,
`desc`=%s, version=%s, minreqs=%s, wareid=%s, catid=%s, hpage=%s,
dllink=%s, dlsize=%s, liveyn=%s, triallength=%s, price=%s, keywords=%s,
submitdate=%s, submittime=%s, livedate=%s, livetime=%s WHERE swid=%s",
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['shortdesc'], "text"),
GetSQLValueString($_POST['desc'], "text"),
GetSQLValueString($_POST['version'], "text"),
GetSQLValueString($_POST['minreqs'], "text"),
GetSQLValueString($_POST['wareid'], "int"),
GetSQLValueString($_POST['catid'], "int"),
GetSQLValueString($_POST['hpage'], "text"),
GetSQLValueString($_POST['dllink'], "text"),
GetSQLValueString($_POST['dlsize'], "text"),
GetSQLValueString($_POST['liveyn'], "text"),
GetSQLValueString($_POST['triallength'], "text"),
GetSQLValueString($_POST['price'], "double"),
GetSQLValueString($_POST['keywords'], "text"),
GetSQLValueString($_POST['submitdate'], "date"),
GetSQLValueString($_POST['submittime'], "date"),
// falls over here
GetSQLValueString(current_date(), "date"),
GetSQLValueString(current_time(), "date"),
//GetSQLValueString($_POST['livedate'], "date"),
//GetSQLValueString($_POST['livetime'], "date"),
GetSQLValueString($_POST['swid'], "int"));


Posted by Sam on July 29, 2005, 2:02 am
Please log in for more thread options
I used the MySQL Administrator and created a table with a column called
import_date of type timestamp.
The default value is CURRENT_TIMESTAMP. Therefore when an entry is
inserted or updated, I do not
have to reference this field in my code. It is automatically updated via
mysql.

good luck


Similar ThreadsPosted
lots of time taking when inserting 1000 records July 26, 2006, 2:25 am
Mysql How to sum min max and get the date/time of the min max???? October 13, 2005, 4:23 am
Find date and time of last update April 7, 2006, 7:24 am
how to check for date/time ranges within record (check for schedule conflicts) January 20, 2006, 3:18 pm
Current Month June 6, 2005, 8:55 pm
Converting VARCHAR "date" info to an actual date field August 15, 2005, 7:49 pm
inserting unique value June 21, 2007, 9:20 am
Inserting variables in mySQL table! June 25, 2005, 9:11 am
Inserting records to MYSQL using ODBC May 15, 2006, 4:57 pm
problem in inserting unicode data in forms6i February 24, 2006, 1:56 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy