This is a discussion on "[SOLVED] passing variables to mysql" within the PHP Forum section. This forum, and the thread "[SOLVED] passing variables to mysql are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] passing variables to mysql
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] passing variables to mysql
Ok so, here is my new problem.
My script works out a variable (the users ip) and then needs to pass it to a mysql table. Quite simple. But the trciky bit is that I need my php to run this style of script before it posts the data to the sql. Does the table for this hour exist? y/n (there will only ever be one hour table which needs to be overwritten each hour) Does the table for this day exist? y/n (there will be a new table for each day) Does the table for this week exist? y/n (there will be a new table for each week) Does the table for this month exist? y/n (there will be a new table for each month) Create the corresponding table if neccesarry. Post the data to the all the corresponding tables according to the time and date. By doing this I am keeping all the tables amended and can pull them back into another php file which will read the data and post it accordingly. Ok cool. I hope someone has done this before, as im quite unsure how to do this. |
|
|
|
#2
|
||||
|
||||
|
Re: passing variables to mysql
The table for this hour? I'm not sure what you mean.
Are you creating tables with a cronjob? What would an exmaple for a "table for this hour" look like / be named?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#3
|
|||
|
|||
|
Re: passing variables to mysql
very simple
you need to add to your table a time-stamp cell. then when you want to ask your questions you do it with a SQL statement select * where `theTime` > time() http://php.net/manual/en/function.time.php |
|
#4
|
|||
|
|||
|
Re: passing variables to mysql
ahhh... ok cool thanks! Ive got it now!
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing variables from PHP to Flash | tox0tes | Flash & Multimedia Forum | 4 | Dec 29th, 2007 06:46 |
| Passing variables from Flash to PHP | LostProphet | Flash & Multimedia Forum | 6 | Aug 31st, 2006 14:05 |
| Passing Variables to a require_once() Page | darryladie | PHP Forum | 3 | Jun 20th, 2006 18:36 |
| passing post variables | benbacardi | PHP Forum | 5 | Jul 5th, 2005 22:13 |
| PLEASE HELP - Passing Variables in Querystring | just_the_basix | Classic ASP | 40 | Sep 3rd, 2004 10:46 |