The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> save a query
Mindapolis
post Apr 11 2012, 08:04 PM
Post #1


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



In mysql is there a way to save a query?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Apr 12 2012, 01:41 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 4,744
Joined: 23-August 06
From: Europe
Member No.: 9



What do you mean by "save"? Insert, save to file, export, ...?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Apr 12 2012, 08:19 AM
Post #3


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



Save, as in you could run the query daily.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Apr 12 2012, 08:23 AM
Post #4


Jocular coder
********

Group: Members
Posts: 2,292
Joined: 31-August 06
Member No.: 43



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.)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Apr 12 2012, 09:59 AM
Post #5


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



I'm sorry, I'm relatively new to databases. I didn't know you could save queries in a table.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Apr 12 2012, 10:09 AM
Post #6


Jocular coder
********

Group: Members
Posts: 2,292
Joined: 31-August 06
Member No.: 43



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Apr 12 2012, 10:59 AM
Post #7


WDG Member
********

Group: Root Admin
Posts: 8,097
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Or did you mean parameterized statements?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Apr 12 2012, 12:53 PM
Post #8


Jocular coder
********

Group: Members
Posts: 2,292
Joined: 31-August 06
Member No.: 43



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.)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Apr 12 2012, 07:52 PM
Post #9


WDG Member
********

Group: Root Admin
Posts: 8,097
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



I'm just guessing at what the OP might have meant by "save a query"...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Apr 13 2012, 01:45 AM
Post #10


Programming Fanatic
********

Group: Members
Posts: 4,744
Joined: 23-August 06
From: Europe
Member No.: 9



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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Apr 13 2012, 01:49 PM
Post #11


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



Thank you so much for the advice
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th March 2015 - 08:57 PM