<?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";

print "<option value='$store_id'>$store_name\n";
// 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/>";

$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";

Recommended Answers

Submit your form and retrieve the check box value as

Jump to Post

All 2 Replies

i hope someone will help me in this. huhu

Submit your form and retrieve the check box value as

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.