27.11.2015, 11:43
Hello ive got a lil problem with php in mysql script and i need this forum help
$result = mysql_query("SELECT * FROM `banlog` WHERE name='$name' LIMIT 5");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$banned = $row['banned'];
if($banned == 0) $banned = 'No';
if($banned == 1) $banned = 'Yes';
}
Problem is that if 1 user is banned it shows for all others and i want to add $name into "if" and if banned = 0 the result will be No
Im not good in english and dont know how to write it good so please understand me
$result = mysql_query("SELECT * FROM `banlog` WHERE name='$name' LIMIT 5");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$banned = $row['banned'];
if($banned == 0) $banned = 'No';
if($banned == 1) $banned = 'Yes';
}
Problem is that if 1 user is banned it shows for all others and i want to add $name into "if" and if banned = 0 the result will be No
Im not good in english and dont know how to write it good so please understand me