option block

From: Date: Tue, 04 Sep 2001 19:56:47 +0000
Subject: option block
Groups: php.general 
Request: Send a blank email to php-general+get-65935@lists.php.net to get a copy of this message
Hello everyone, I'm having a problem with my option block... I'm trying to pass the value of uid to the next page. I always get the last uid value in table user. How can I change this so I get to pass the value of the user's choice? $sql = "SELECT user.uid, user.first_name, user.last_name FROM user, company Where company.uid = user.companyUid and company.company = '$PHP_AUTH_USER' ORDER BY last_name "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); while ($row = mysql_fetch_array($result)) { $uid = $row['uid']; $first_name = $row['first_name']; $last_name = $row['last_name']; $option_block .= "<option value=\"$uid\">$last_name, $first_name</option>"; } $display_block = " <FORM METHOD=\"post\" ACTION=\"show_moduser.php\"> <P><strong>User:</strong> <select name=\"uid\"> $option_block </select> <INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Select this User\"></P> </form> ";

« previous php.general (#65935) next »