0
<?php                                                                $id=$result;
$res=@mysql_query("Select * from t_stores where user_id='$id'");
print "<label>Select Company/Store </label>";
print "<select name=\"store_id\">\n";
print "<option value=''>\n";
while($row=mysql_fetch_assoc($res)){


$store_id=$row;
$store_name=$row;
print "<option value='$store_id'>$store_name\n";
$store=$_GET;
// a noob way that above to get store_id but it wont work-->                                                            }
?>


//how do i get the $store_id in the print above so that i could use for the query below.
//the query below will be used so that branches will be printed which corresponds to the store_id


print "</select>\n";
print "<br/>";


<?php
$res=@mysql_query("Select * from t_branches where store_id='$store'");
print "<label>Select Branch Name</label>";
print "<select name=\"branch_id\">\n";
print "<option value=''>\n";
while($row=mysql_fetch_assoc($res)){                                                                    $branch_id=$row;                                                                    $branch_name=$row;


print "<option value='$branch_id'>$branch_name\n";                                                               }
print "</select>\n";
?>

Edited by Nick Evan: Fixed formatting

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by divyakrishnan
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.