Ip-Ban | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Ip-Ban

Hello! Please tell me the following script: in the database my sql if the string = "Yes", then the user is blocked by the ip, if "No", then it is blocked Thank you.

11th Jul 2018, 3:32 PM
Паша Рожков
Паша Рожков - avatar
1 Answer
0
$sql = "SELECT * FROM user WHERE ip = '$ip"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_assoc($result)) { $string = $row["is_banned"]; } if ($string === "No") { /* User is not banned */ } else { /* User is banned */ }
22nd Jul 2018, 12:45 AM
N00B