Current location: Hot Scripts Forums » Programming Languages » PHP » Sending date to Database


Sending date to Database

Reply
  #1 (permalink)  
Old 01-13-05, 06:36 PM
blessedrub blessedrub is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Sending date to Database

I have trying to send the date to my database along with other information that is being inserted. Could someone PLEASE assist me.

My declarations are as follows...
$Phone = $_POST["Phone"];

This is my query statement
$Query="INSERT INTO $TableName (Amount,FirstName,LastName,Address,Email,Phone,Dat e) VALUES ('$_POST[Amount]','$_POST[FirstName]','$_POST[LastName]','$_POST[Address]','$_POST[Email]','$_POST[Phone]')";

How can I send the date along with the data being entered?
Grateful for help
Reply With Quote
  #2 (permalink)  
Old 01-13-05, 08:40 PM
OnlineDesignz OnlineDesignz is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Hello,

First you need to create a mysql connection then you can use the mysql_query function. You will need a new row in the database for the date to be entered you can do this using the built in datetime row.

Here is the coding you will need below:

@mysql_query("INSERT INTO TableName (Amount, FirstName, LastName, Address, Email, Phone, Date) VALUES ('$_POST[Amount]', '$_POST[FirstName]', '$_POST[LastName]', '$_POST[Address]', '$_POST[Email]', '$_POST[Phone]', now()");

If you have any more trouble please contact me at my site: www.onlinedesignz.com (click community). I am not sure I will check back here.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form to update a MySQL database? Scoobler PHP 9 09-04-08 01:41 AM
js date franches JavaScript 1 11-25-04 08:42 AM
inserting and retrieving date and time from mysql database stealth04 PHP 5 07-29-04 11:19 AM
I need help with sending information from a form to a database blessedrub PHP 14 07-27-04 07:19 PM
Access Database Date Problem emvanlill Windows .NET Programming 2 05-10-04 03:06 AM


All times are GMT -5. The time now is 05:25 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.