hello i have some question.
how to make if staitment if is true, loop if staitment ,else return my staff
function checkSlot($member_id){
$i = 1;
$query = mysql_query("SELECT * FROM `inventory` WHERE `member_id` = '".$member_id."'");
$row = mysql_fetch_array($query);
if($row['slot'.$i.''] > 0){
$i++;
}else{
return true;
}
You need a looop to check all the values.
Also, consider using
PDOormysqli_()functions (notmysql_()) as the mysql will be deprectiated. Get used to the new methods before you get used to the old and need to rewrite everything.I’ve forced the $member_id to an integer to make it safe – otherwise use
mysql_real_escape_string()as a bare minimum (or preferablyPDOormysqli_()functions as above)