Tell me how to execute an sql query? How to fetch its result?
Answer / Sanjeev Aherwar
"To execute an SQL query, you can use PHP's MySQL extension. Here is an example: nn$db = new mysqli("localhost", "username", "password", "database");nif ($db->connect_error) {n die("Connection failed: " . $db->connect_error);n}nn$sql = "SELECT * FROM table";n$result = $db->query($sql);nnWhile ($row = $result->fetch_assoc()) {n echo $row['columnName'];n}""
| Is This Answer Correct ? | 0 Yes | 0 No |
Why do we use interface in php?
Explain about objects in PHP?
Does mysql need php?
What is the difference between $message and $$message in php?
Is it possible to submit a form with a dedicated button?
How to create connection in php?
what is the url rewriting?how to rewrite the url? give any example
in PHP for pdf which library used?
coding for deleting items form data base on select
How to turn on the session support?
What is the difference between htmlentities() and htmlspecialchars()?
Is php worth learning in 2019?