473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

inserting current date and time

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"));
Jul 23 '05 #1
1 2053
Sam
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
Jul 29 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jonathan Moss | last post by:
I have (almost) succesfully created a linked list data structure class. It will quite happily add items to to the end of the list (once I found that objects are not passed by reference :). What I...
0
by: Paolo Tardivel via DotNetMonster.com | last post by:
I have a databound datagrid containing template columns which allow editing of the values contained in the datagrid through the use of text boxes. One of the fields in the datagrid displays the...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
0
by: Niketa Mahana | last post by:
Hi, We are in the process of making product in windows forms that is localized presently for all european countries.We are supposed to support all eastern and western european date , time and...
2
by: Paul | last post by:
I'm sure this isn't a difficult question, but I've been struggling trying to insert the current date into a sql server field. I've tried numerous suggestions that I've seen in newsgroups and...
6
by: fniles | last post by:
I am using VB.NET 2003 and SQL Server 2000. I have a table with a datetime column type. When inserting into the table for that column, I set it to Date.Now.ToString("T") , which is something like...
2
by: Serious_Practitioner | last post by:
Hi, and thank you in advance for any assistance. I would like to use a script to determine if a date meets a condition, and, if it does, then create a table row with a couple of cells, and then...
13
by: imnewtoaccess | last post by:
Hi, I am getting errors while inserting records in one table from another. These are the structures of two tables : file51tm_new RecordType Text
1
by: assgar | last post by:
Hi I need help. I know what I want to accomplish, but I do not know how to do it. WHAT I NEED HELP ACCOMPLISHING: How to do I insert data into a table for a date range of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.