Help - Search - Members - Calendar
Full Version: save a query
HTMLHelp Forums > Programming > Databases
Mindapolis
In mysql is there a way to save a query?
Frederiek
What do you mean by "save"? Insert, save to file, export, ...?
Mindapolis
Save, as in you could run the query daily.
Brian Chandler
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
I'm sorry, I'm relatively new to databases. I didn't know you could save queries in a table.
Brian Chandler
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
Or did you mean parameterized statements?
Brian Chandler
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
I'm just guessing at what the OP might have meant by "save a query"...
Frederiek
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
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.
Invision Power Board © 2001-2024 Invision Power Services, Inc.