<?php
require_once("./Connections/root.php");
mysql_select_db($database_root, $root);
include 'p_settings.php';
session_start();
$user = $_SESSION['MM_Username'];
$q = mysql_query("SELECT id FROM performer WHERE username='$user' LIMIT 1") or die("Error : " . mysql_error());
$r = mysql_fetch_assoc($q);
$id = $r['id'];
?>
You can set three countries as banned." <br>
Please choose from the following countries:
<?php
$query = mysql_query("SELECT * FROM performer_s WHERE id='$id' LIMIT 1");
$res1 = mysql_fetch_assoc($query);
if($res1['baned_c'] != NULL) { $res1 = $res1['baned_c']; } else { $res1 = "NONE"; }
if($res1['baned_c2'] != NULL) { $res2 = $res1['baned_c2']; } else { $res2 = "NONE"; }
if($res1['baned_c3'] != NULL) { $res3 = $res1['baned_c3']; } else { $res3 = "NONE"; }
echo "<form action=p_settings_ban_s.php>";
echo "<select name=country>";
echo "<option value=>NONE</option>";
$query1 = mysql_query("SELECT DISTINCT country_name FROM country_list ORDER BY country_name ASC");
while($row1 = mysql_fetch_assoc($query1)) {
if($row1['country_name'] == $res1)
{ echo "<option selected value=" . $row1['country_name'] . ">" . $row1['country_name'] . "</option>"; }
else
{ echo "<option value=" . $row1['country_name'] . ">" . $row1['country_name'] . "</option>"; }
}
echo "</select>";
echo "<select name=country2>";
echo "<option value=>NONE</option>";
$query2 = mysql_query("SELECT DISTINCT country_name FROM country_list ORDER BY country_name ASC");
while($row2 = mysql_fetch_assoc($query2)){
if($row2['country_name'] == $res2)
{ echo "<option selected value=" . $row2['country_name'] . ">" . $row2['country_name'] . "</option>"; }
else
{ echo "<option value=" . $row2['country_name'] . ">" . $row2['country_name'] . "</option>"; }
}
echo "</select>";
echo "<br /><input type=submit value=Update List />";
echo "</form>";
echo $res2;
mysql_close();
?>
so this is my code....$query1 works fine....$query2 doesen't....$res2 returnes only the first leather of the name from the DB
In the DB its ALGERIA and i only get A