by banpei

PHP and MySQL stored procedures

March 31, 2008 in programming by banpei

Another programming entry today. 😉

Basically it isn’t really much, but it’s more or less a short description I encountered last week. Apparently this is very unclear and not well documented. So I thought I’d share it with the world. 🙂

Normally people use the Mysqli interface of PHP to invoke MySQL. Standard usage is open connection, query and then get result rows and close the connection. So you would use the functions Open, Query, Fetch_row, Close.

This scenario works for 99,9999% of the MySQL queries used in the world. However this does not work for stored procedures with multiple result sets!

The Mysqli Query function is capable of invoking the stored procedure, however if the stored procedure consists of a multiple result set it will only run the stored procedure up till the point of the first result set. The stored procedure can only be run properly by using Mysqli Multi_query function along with the Next_result function.

See also here:

And this is how it should be solved:

I hope this helps someone in the future. 🙂

by banpei

More Carina ads

March 28, 2008 in video by banpei

Found some more Toyota Carina TA60/TA61/AA63/TA63 ads on Youtube:

And what about this great 1984 Toshiba VCR ad by Ultraman?

Are all Japanese ads from the 80s this whacky??

by banpei

Get video information from Youtube with Ajax

March 10, 2008 in programming by banpei

This will be overwritte with the title of the movie after loading the details through Ajax…

I started this small experiment for my work to see what the Youtube api is capable of and I found out that there are some very interesting things in their Api… I found use of getting the titles and stuff to re-use on the AEU86 forum. 🙂