Good day all:

I have a mysql insert statement inserting data to db. The value of one of the variables is:

' $_POST[servicedesc]')

I want to be able to append the current date and time in front of this value and then insert into the db. This value will be inserted into a text field so I would like to have the date and time on a line different than the value.

Any thoughts on this!
Mossa

Recommended Answers

All 2 Replies

$time = mysql_fetch_array(mysql_query("select now()"));
echo $time['now()'];

You can use the $time variable to add the current server time.

Problem resolved!

Thank you all that posted replies. Here is the solution that is working for me based on my initial post --hope it helps someone else!

CONCAT(NOW(), '\n\n' '$_POST[servicedesc]','\n\n----End of Service Report---'))";

The very best!
Mossa

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.