Answer the question
In order to leave comments, you need to log in
How to make a request to Oracle from PHP?
Good afternoon, I’m completely confused, many examples are everywhere and I can’t decide which one is correct
. From PHP, I connect to MySQL like this:
<?php
$conn = new mysqli("servername", "user", "password", "databasename");
$sql = "SELECT id, firstname, lastname FROM users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["id"] . " " . $row["firstname"] . " " . $row["lastname"] . "<br>";
}
}
$conn->close();
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question