Codeman0013 Posted September 22, 2006 Share Posted September 22, 2006 Hey is it possible to run a query and not allow the others to run until the ones above it have been executed like on page load i only want one thing to load and as the user submits then run the next on and so on here is my code if its possible ot change it i would appreciate any tips..[code]mysql_select_db($database_conn_dj, $conn_dj);$query_rs_industry = "SELECT industry_id, industry_name FROM tbl_industry ORDER BY industry_name ASC";$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());$row_rs_industry = mysql_fetch_assoc($rs_industry);$totalRows_rs_industry = mysql_num_rows($rs_industry);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_productcategory = "SELECT productCat_id, productCat_name, industry_id FROM tbl_productcat WHERE industry_id = '$_GET[industry_id]' ORDER BY productCat_name";$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_product = "SELECT products_id, products_name, productCat_id FROM tbl_products WHERE productCat_id = '$_GET[productCat_id]' ORDER BY products_name";$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());$row_rs_product = mysql_fetch_assoc($rs_product);$totalRows_rs_product = mysql_num_rows($rs_product);mysql_select_db($database_conn_dj, $conn_dj);$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY intl_countries.name";$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);[/code] Link to comment https://forums.phpfreaks.com/topic/21715-is-it-possible/ Share on other sites More sharing options...
Seraph Posted September 22, 2006 Share Posted September 22, 2006 Ajax seems like your only hope. Though that is too advanced for you if you can't figure it out your self. And I don't know ajax too well. sorry Link to comment https://forums.phpfreaks.com/topic/21715-is-it-possible/#findComment-96973 Share on other sites More sharing options...
fenway Posted September 25, 2006 Share Posted September 25, 2006 Well, depending on how large these tables are, you might be able to preload this and do it client-side... Link to comment https://forums.phpfreaks.com/topic/21715-is-it-possible/#findComment-97912 Share on other sites More sharing options...
Daen Posted September 27, 2006 Share Posted September 27, 2006 If you don't mind having the page reload every time the user submits something or picks a new value, then you can do it with php and a little bit of javascript. You just need to have a few hidden form fields on your page, and when the user submits one button, the javascript sets the form field value to some flag key value, then submits the form with page.submit(). Your php code looks for the flag value, then runs the query you want, and spits out the result page with the new results of the query.If you do mind the page reloading, then you'll have to go with AJAX, I think. Link to comment https://forums.phpfreaks.com/topic/21715-is-it-possible/#findComment-99323 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.