trying to get 2 rows from MYSQL
Posted: Fri May 06, 2005 3:51 pm
is this code correct:
When I do this, no informatin is display, I than remove "AND u_group=2" from $query and it works...
is the code wrong? or how do I get two rows from MySQL?
thanks.
Jcart | Please review
Posting Code in the Forums
Code: Select all
$query = "SELECT concat(u_first_name, ' ', u_last_name) AS name FROM users WHERE u_group=1 AND u_group=2";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
echo "<select name=\"submitter\" id=\"submitter\">";
echo "<option value=\"0\" selected>Employee</option>";
while ($row = mysql_fetch_array($result)) {
printf ("<option value=\"{$row['name']}\">{$row['name']}</option>/n");
}
echo"</select>";is the code wrong? or how do I get two rows from MySQL?
thanks.
Jcart | Please review