Click to See Complete Forum and Search --> : Is it possible?


Codeman0013
09-22-2006, 04:29 PM
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..

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);

chazzy
09-23-2006, 01:53 PM
you need to have processing logic for each item. how do you identify each post as a different posting? different form fields or what?

Codeman0013
09-24-2006, 02:25 PM
you need to have processing logic for each item. how do you identify each post as a different posting? different form fields or what?


i dont know if this is what you wnat or not but i have 3 dropdowns each one refreshes the page each time it resends its value into the url and refreshes and populates the next dropdown is there a way to stop these from going until the see a value for them?

NogDog
09-24-2006, 05:56 PM
Is something like this what you're talking about?

if(isset($_GET['some_id']) and $_GET['some_id'] !== "")
{
// do the query (or queries)
}

chazzy
09-24-2006, 07:17 PM
i dont know if this is what you wnat or not but i have 3 dropdowns each one refreshes the page each time it resends its value into the url and refreshes and populates the next dropdown is there a way to stop these from going until the see a value for them?

then what you need to do is check to see if ONLY that value changed (on first change, send the form back and it checks to see if the first one changed, and alter the population based on that value.) and repeat for each one.