OK, I changed some code and got the it to this point: The following info comes from protection.php and is passed to menu.php
client id: 8
agent_id: 5
menu.php --- The following code works, but I'd like to be able to retrieve the record with the where instead of searching the entire table:
echo "client id: " ."$id" . "<br>";
echo "agent_id: " . "$agent_id" . "<br>";
$query="SELECT * FROM agents";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$id_table = mysql_result($result,$i,"id");
if ($id_table == $agent_id) {
$id = mysql_result($result,$i,"id");
$agency_type = mysql_result($result,$i,"agency_type");
$agency_name = mysql_result($result,$i,"agency_name");
$agency_address_1 = mysql_result($result,$i,"agency_address_1");
$agency_address_2 = mysql_result($result,$i,"agency_address_2");
$agency_city = mysql_result($result,$i,"agency_city");
$agency_state = mysql_result($result,$i,"agency_state");
$agency_zip_code = mysql_result
$i = $num; }
else
++$i;
}
I know I can use:
$query="SELECT * FROM clients where id=$agent_id";
based on what you said. But I think the mysql_result needs to be replaced. The $i needs to be replaced.
I guess I'm just asking how to do the above but by using the "where" instead of searching.
Thanks again,
Gary