RE: [PHP] option block

From: Date: Tue, 04 Sep 2001 21:38:21 +0000
Subject: RE: [PHP] option block
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65954@lists.php.net to get a copy of this message
Jeremy: Have you tried echoing your $sql variable to ensure it has in it what you expect? In other words, does $PHP_AUTH_USER have the value you need it to have? hth Happy programming! Chris Mulcahy > -----Original Message----- > From: Jeremy Morano [mailto:jeremy@prepresshelp.com] > Sent: Tuesday, September 04, 2001 2:57 PM > To: php-general@lists.php.net > Subject: [PHP] option block > > > 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> > > "; > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#65954) next »