Mindapolis
Apr 11 2012, 08:04 PM
In mysql is there a way to save a query?
Frederiek
Apr 12 2012, 01:41 AM
What do you mean by "save"? Insert, save to file, export, ...?
Mindapolis
Apr 12 2012, 08:19 AM
Save, as in you could run the query daily.
Brian Chandler
Apr 12 2012, 08:23 AM
If the query is 'Q', simply run a program every day (see 'cron') that includes:
mysql_query('Q');
(The answer to your original question is strictly "Yes", because you can make a table with a column 'query' and save queries in it. But it's not clear what use this would actually be.)
Mindapolis
Apr 12 2012, 09:59 AM
I'm sorry, I'm relatively new to databases. I didn't know you could save queries in a table.
Brian Chandler
Apr 12 2012, 10:09 AM
QUOTE
I'm sorry, I'm relatively new to databases. I didn't know you could save queries in a table.
Well, you can save strings in a database table, and queries are strings, therefore (provided you escape them properly) you can save queries in DB tables.
Darin McGrew
Apr 12 2012, 10:59 AM
Or did you mean parameterized statements?
Brian Chandler
Apr 12 2012, 12:53 PM
QUOTE
Or did you mean parameterized statements?
What difference would it make? Are not parameterized statements represented by strings? (There's the obvious problem of how to pass the parameters, but the question is so up in the air my head is spinning.)
Darin McGrew
Apr 12 2012, 07:52 PM
I'm just guessing at what the OP might have meant by "save a query"...
Frederiek
Apr 13 2012, 01:45 AM
QUOTE(Mindapolis @ Apr 12 2012, 04:59 PM)
I'm sorry, I'm relatively new to databases. I didn't know you could save queries in a table.
Then you should take a look at
http://devzone.zend.com/6/php-101--php-for...olute-beginner/ , where there's also a chapter on databases (part 8).
Mindapolis
Apr 13 2012, 01:49 PM
Thank you so much for the advice
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.