Aug 14, 2002 #1 Sleidia Technical User May 4, 2001 1,284 FR Hello, What is the most elegant way to send multiple queries to a mysql DB in one single call (without the need to open/close a connection for each query)? Thanks for helping!
Hello, What is the most elegant way to send multiple queries to a mysql DB in one single call (without the need to open/close a connection for each query)? Thanks for helping!
Aug 14, 2002 #2 AnakinPt Programmer Mar 29, 2001 583 PT You can send multiple queries in one connection... you don't need to open and close the connection all the time Usualy you only need to open the connection in beggining of the page, and you close it in the end, and between you do all the queries. Anikin Hugo Alexandre Dias Web-Programmer anikin_jedi@hotmail.com Upvote 0 Downvote
You can send multiple queries in one connection... you don't need to open and close the connection all the time Usualy you only need to open the connection in beggining of the page, and you close it in the end, and between you do all the queries. Anikin Hugo Alexandre Dias Web-Programmer anikin_jedi@hotmail.com
Aug 14, 2002 Thread starter #3 Sleidia Technical User May 4, 2001 1,284 FR Hello Anikin, What you said can't work on my side and always produces errors. I guess the reason in explained here: http://www.ashleyit.com/blogs/brentashley/archives/000342.html What's your opinion? Upvote 0 Downvote
Hello Anikin, What you said can't work on my side and always produces errors. I guess the reason in explained here: http://www.ashleyit.com/blogs/brentashley/archives/000342.html What's your opinion?
Aug 14, 2002 #4 AnakinPt Programmer Mar 29, 2001 583 PT What in the hell? You can always do this: $conn=mysql_connect(server,login,password); mysql_select_db(database); $res1=mysql_query("SELECT count(1) from table" $res2=mysql_query("INSERT INTO table VALUES (id,title)" list($count)=mysql_fetch_row($res1); mysql_disconnect($conn); Anikin Hugo Alexandre Dias Web-Programmer anikin_jedi@hotmail.com Upvote 0 Downvote
What in the hell? You can always do this: $conn=mysql_connect(server,login,password); mysql_select_db(database); $res1=mysql_query("SELECT count(1) from table" $res2=mysql_query("INSERT INTO table VALUES (id,title)" list($count)=mysql_fetch_row($res1); mysql_disconnect($conn); Anikin Hugo Alexandre Dias Web-Programmer anikin_jedi@hotmail.com