im using amfphp to connect flash to a database. im having speed issues with the queries, which i assumed was due mostly to the overhead of using amfphp. but i just tried executing my queries and timing them using php only... they are kinda slow but not bad, except one query sometimes hangs. the page just stops executing, it gives up (says "done" in the browser) without returning the results or giving an error. this happens in flash sometimes as well, so even in flash its receiving no error returned from the function call. it just stops and considers itself done.
i know just enough SQL to get by, and the query that sometimes chokes is kinda terrible, but when i finally got it to work i was so amazed i just left it. is there a better way to do it? any theories on what would cause php to sort of time out while doing it, and stop without creating an error? it seems to choke mostly the first time you try it after a break. subsequent tries usually go through.
$page_id is a number passed to the function. im basically trying to get the info for every Page Item but it resides in several tables... this monstrosity usually works, except when it doesnt (in my tests $page_id is always the same). on my local server it takes between .004 and .01 seconds and always works. on the remote server it takes between .03 and forever.
any clues? thanks!
i know just enough SQL to get by, and the query that sometimes chokes is kinda terrible, but when i finally got it to work i was so amazed i just left it. is there a better way to do it? any theories on what would cause php to sort of time out while doing it, and stop without creating an error? it seems to choke mostly the first time you try it after a break. subsequent tries usually go through.
Code:
SELECT DISTINCT page_items.name, page_items.url, page_items.html_text, (SELECT user_images.cleared FROM user_images WHERE page_items.url = user_images.image_url) as cleared, page_items.text_cleared, (SELECT pages.shortcut_title FROM pages WHERE pages.id = {$page_id}) as shortcut FROM page_items, user_images, pages WHERE page_items.page_id = {$page_id}")
$page_id is a number passed to the function. im basically trying to get the info for every Page Item but it resides in several tables... this monstrosity usually works, except when it doesnt (in my tests $page_id is always the same). on my local server it takes between .004 and .01 seconds and always works. on the remote server it takes between .03 and forever.
any clues? thanks!