byrne86 Posted November 1, 2010 Share Posted November 1, 2010 I have a cron job that creates a table once a day, the problem I am having is, I need the name of the table to be todays date, I have tried using a php variable, but I couldnt get the CREATE to have a php variable as the tablename. What is the best way to make the tablename being created todays date? Also, what is the best way to get 10 entries from 1 table on a database and insert them into a different table on a different database using php? Thanks Link to comment https://forums.phpfreaks.com/topic/217481-few-sql-problems/ Share on other sites More sharing options...
Pikachu2000 Posted November 2, 2010 Share Posted November 2, 2010 Post the code you tried to use to create the table. Why do you think you need to create a new table every day, anyhow? Link to comment https://forums.phpfreaks.com/topic/217481-few-sql-problems/#findComment-1129299 Share on other sites More sharing options...
byrne86 Posted November 2, 2010 Author Share Posted November 2, 2010 Forget that problem, I have sorted it out, I do have a new problem though. I am trying to automatically insert a datetime into a field on a table from a web form, everything I have tried has just returned 0000-00-00 00:00:00, I want to use the SQL datetime, and not the php timestamp, so I can sort it better in my database Link to comment https://forums.phpfreaks.com/topic/217481-few-sql-problems/#findComment-1129380 Share on other sites More sharing options...
Pikachu2000 Posted November 2, 2010 Share Posted November 2, 2010 Again, we'd need to see the relevant code, and would need to know the database field type (DATETIME, VARCHAR, etc). Link to comment https://forums.phpfreaks.com/topic/217481-few-sql-problems/#findComment-1129452 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.