i want to select some rows in my mysql databases, I have 3 tables with the same structure, I have tried using the script that I created and this works, but it seems like it takes too many lines in my script.
<?php
$check1 = mysqli_query($con, "SELECT * FROM text WHERE keyword='$string'");
$check2 = mysqli_query($con, "SELECT * FROM sticker WHERE keyword='$string'");
$check3 = mysqli_query($con, "SELECT * FROM image WHERE keyword='$string'");
if(mysqli_num_rows($check1) == 0 && mysqli_num_rows($check2) == 0 && mysqli_num_rows($check3) == 0) {
echo "success";
}
?>
is there another way to shorten my script above ? thank you :)