Jump to content

[SOLVED] Table Insert & Date:Time


shlomikalfa

Recommended Posts

it's been all night i'm up and trying to make these work but HOW ?!?!

Please Help!!!

___________

 

 

how do i make MySQL add the current date:time on new table insertion ?!

- want to know if there is such an option that makes the MySQL db add the date:time data to a table collumn on it's own.

- also, how do i make MySQL auto-increment a collumn var whenever it's being read ?!

 

 

 

____________

Please Help!!!

THANKS ALOT IN ADVANCE !!!

Link to comment
https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/
Share on other sites

i already got a table but i want to have in my table the following 2 fields:

-> field "date", i want that field to be automatically filled with the date/time of the MySQL DB as the new entry is created.

-> field "Counter", i want that field to be automatically filled to hold the number of times it was found by MySQL quaries.

 

i thinks that's better...

please help me  ???

i am not sure about ur q's, but why not use php to update date:

$date=CURDATE();

 

and then put the $date variable in the insert or update query.When the script run it will automatically update the field date without input by user.

 

for counter  field just try it like this:

counter=counter+1;

in ur query, every time the script run it will update the field counter with one increment.

 

Hope this will help.

to use that:

counter=counter+1;

 

i have to request the count from the mysql table first and then add counter to it right ?!

(and same with date...)

 

- i was asking if there is a way to do it without retrieving the var and then inserting a new one after it's been processed...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.