SQL Procedures and Functions
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
SQL Procedures and Functions
If i were to make a SQL function or procedure, I assume I can store it in a seperate file (most likely .sql file) but how would i go about including it, and calling the function etc?
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Re: SQL Procedures and Functions
I'm not sure it's possible in a nice way, you can do a shell_exec as described here http://stackoverflow.com/questions/4027 ... les-in-php but that will open new connection for every query (slow) and uses shel_exec (slower).
Not tried, but could you do
Not tried, but could you do
mysql_query(file_get_contents('thingy.sql'));?
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: SQL Procedures and Functions
Apparently
mysql_query('call procedure_name()');Will work
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9