Web Hosting Talk







View Full Version : Need some help with mySQL/cron jobs please


desk2web
06-27-2006, 05:35 AM
Hi there, I know I should be able to work this out, but I've been working frantically for 2 days straight and my head is fried! So thought I's make use of some of the geniuses on here to hopefully help me out!

I have a mySQL database (its actually a customised osCommerce site) and I need to create a script which will initially create a new table, copying data from a number of the tables into one data table (this table will be used by ODBC to be the source for mail merges etc)

I know all the tables and fields I need to use, but I cannot work out what to do next lol !

So, once again, I have tables/fields that I need to use in script to create a new table, and then have a cron job to check and update the new table every 1 or 2 hours as necessary.

Any help or suggestions would be appreciated! Thanks in advance

jeffbailey
06-27-2006, 07:26 AM
It sounds to me like you need to write a SQL query that queries all the data from the tables, creates a table, then inserts this selected data into the table. Do you know SQL?

Kalyse
06-27-2006, 07:47 AM
Why are you creating more tables? So is this going to be continous? A new table for every time the query is ran?

Advancewebsoft
07-01-2006, 08:52 PM
Why then just write a script (in a Cron) so it will update some temporary table (no need to create a new table, just update existing) and then check (e.g. send some e-mail I assume) and delete the data from the temporary table. Then you'll use 1 temp table which will be filled/deleted with the info.