Using AI
AI appears to be a great learning tool! As a newbie, it helps a lot. I simply want to see if the provided "jobnumber" exists in the database. I most likely would not have used this, but is the following AI generated code secure?
$stmt = $conn->prepare("SELECT COUNT(*) FROM orderform WHERE jobnumber = ?");
$stmt->bind_param("s", $jobnumber);
$stmt->execute();
$stmt->bind_result($count);
$stmt->fetch();
$stmt->close();
if ($count > 0) {
echo "Job number $jobnumber exists in the database.";
} else {
echo "Job number $jobnumber does not exist in the database.";
}
Thanks.
Subject
Written By
Posted
Using AI
June 01, 2024 08:53AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.