Advertisement
Google Ad Slot: content-top
MySQL Select Data
To fetch records from a MySQL database using PHP, you can use MySQLi (Procedural & Object-Oriented) or PDO.
The SELECT statement is used to select data from one or more tables
Syntax:
SELECT column1, column2 FROM table_name;
or to select all columns:
SELECT * FROM table_name;
"; } } else { echo "0 results"; } // Close connection mysqli_close($conn); ?>
"; } } else { echo "0 results"; } // Close connection $conn->close(); ?>
"; } } else { echo "0 results"; } } catch (PDOException $e) { echo "Error: " . $e->getMessage(); } // Close connection $conn = null; ?>