<?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";
?>
Shernykens 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.