shlomikalfa Posted August 23, 2007 Share Posted August 23, 2007 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 More sharing options...
corillo181 Posted August 23, 2007 Share Posted August 23, 2007 explain better.. you want a table in mysql? you want a field of date and time a id field and what else? what's the reason for this table. Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-331558 Share on other sites More sharing options...
Tandem Posted August 23, 2007 Share Posted August 23, 2007 I'm not sure how to find the creation date of a table via command line, but if you use phpmyadmin, the creation date of a table is displayed when you view the structure of the table. Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-331569 Share on other sites More sharing options...
shlomikalfa Posted August 23, 2007 Author Share Posted August 23, 2007 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 ??? Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-331571 Share on other sites More sharing options...
mmarif4u Posted August 23, 2007 Share Posted August 23, 2007 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. Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-331580 Share on other sites More sharing options...
shlomikalfa Posted August 23, 2007 Author Share Posted August 23, 2007 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... Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-331905 Share on other sites More sharing options...
shlomikalfa Posted August 27, 2007 Author Share Posted August 27, 2007 no way there is no way to do it ?! - anyone else ?! Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-334820 Share on other sites More sharing options...
teng84 Posted August 27, 2007 Share Posted August 27, 2007 - 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... explain plzz Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-334822 Share on other sites More sharing options...
shlomikalfa Posted August 27, 2007 Author Share Posted August 27, 2007 What is there to explain ?! - can MySQL DB by a predefined variable or perhaps a column property (on it's own!!!) ADD +1 to that column ?! (can it automatically increment a table variable whenever that is being called ?!) Link to comment https://forums.phpfreaks.com/topic/66285-solved-table-insert-amp-datetime/#findComment-334829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.