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,358
Joined: 23-August 06
From: Europe
Member No.: 9



What do you mean by "save"? Insert, save to file, export, ...?


--------------------
"The earth does not belong to us. We belong to the earth."
from Vue du ciel (in French)

"Leave scepticism to others and take action"
from HOME by Goodplanet

An inconvenient truth by Al Gore
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,224
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.)


--------------------
Brian Chandler
Nothing in this post constitutes "commercial solicitation". PayPal does not solicit residents of Japan. Contents may settle in transit. "Legal mind" may or may not be brain-damaged.
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,224
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.


--------------------
Brian Chandler
Nothing in this post constitutes "commercial solicitation". PayPal does not solicit residents of Japan. Contents may settle in transit. "Legal mind" may or may not be brain-damaged.
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,011
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Or did you mean parameterized statements?


--------------------
Darin McGrew
WDG Member since 1998
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,224
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.)


--------------------
Brian Chandler
Nothing in this post constitutes "commercial solicitation". PayPal does not solicit residents of Japan. Contents may settle in transit. "Legal mind" may or may not be brain-damaged.
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,011
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"...


--------------------
Darin McGrew
WDG Member since 1998
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,358
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).


--------------------
"The earth does not belong to us. We belong to the earth."
from Vue du ciel (in French)

"Leave scepticism to others and take action"
from HOME by Goodplanet

An inconvenient truth by Al Gore
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: 17th September 2014 - 08:32 AM