I'm a designer and not developer, so I don't even know HOW to ask this question.
I have a select box in my script and it shows only one user type. But I need it to show more user types, for example, user_type 2, but Ive tried adding AND / OR and it doesnt work.
Heres the script code.
$result = mysql_query ('SELECT id,email,username FROM ' . $dbacct . '
WHERE user_type="3" ORDER BY username ASC', $link) or die(mysql_error());
Heres the full line
<select class=\'widtha\' name=\'contact_user\'>
';
$result = mysql_query ('SELECT id,email,username FROM ' . $dbacct . ' WHERE user_type IN ("2","3") ORDER BY username ASC', $link) or die(mysql_error());
while ($row = mysql_fetch_array ($result))
{
$row = safe_data ($row, 'display');
echo '<option value=\'' . $row['email'] . '\'';
if ($row[id] == $_POST[contact_user])
{
echo ' selected=\'selected\'';
}
echo '> ' . $row['username'] . '</option>';
}
echo '</select>
Please can someone help me. Anton
<select class=\'widtha\' name=\'contact_user\'>you should be doing<select class='widtha' name='contact_user'>and do the same for the rest. You only need to escape double quotes when echoing/wrapping in single quotes.echo ' selected=\'selected\'';should beecho 'selected=\"selected\"';echo '> ' . $row['username'] . '</option>';will definitely give you a hard time with the'>and thisecho '</select>should beecho '</select>';at best. I suggest you find and study PHP tutorials on how to echo, and the use of single and double quotes. An hour of reading will definitely help you to have a bit of developing "blood" into you ;-)' . $dbacct . 'you should be doing'" . $dbacct . "'