Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everybody,
I have deveoped a portal using apache+php+mysql.
invoking mysql query through the php mysql_query fucntion is alright, but if I have to send three or four queries (say as a batch file), what should I do ?
Say I have to send:
locak tables mytable write;
update mytable set myfield="myvalue";
unlock tables;
One mehtod is that I should invoke mysq_query function for all the three queries seperately one after another. But I feel, that would inefficient, and there should be some better way.
Am I right ?
What other better alrtnatives are available.
Hi folks,
I am sorry I am late. In fact, I was out of town for las few days.
Can you elaborate that "stored Proceedure" part. I feel the situation that I have encountered is not at all so un-common. php+mysql+apache is a very potent combination and the same must definitely be serving very high volume os traffick, making table-locking or sql-scripts unavoidable. Prbabley the stored proceedures as suggested is the answer. I would request you to please elaborate on the same.
the MySQL C API's mysql_query() function (as used in PHP) is quite intentionally designed to only allow one query at a time. So, without procedures, there's no real way to do it directly within PHP without some nasty shell_exec()/backtick calls to MySQL
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.