Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_host = "localhost";
- $db_username = "root";
- $db_password = "123";
- $db_database = "testMySQL";
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Test DB</title>
- </head>
- <body>
- This is a normal HTML
- <br><br>
- <?php
- $db = mysql_connect($db_host, $db_username, $db_password);
- if (!$db) {
- die('Could not connect: ' . mysql_error());
- }
- echo 'Connected successfully';
- mysql_select_db($db_database, $db) or die('Could not select database.');
- ieu
- $sql = "SELECT * FROM customer;";
- $result = mysql_query($sql);
- while($row = mysql_fetch_assoc($result)) {
- //echo '123';
- echo $row['customer_id'];
- echo $row['customer_name'];
- echo $row['customer_dob'];
- echo $row['customer_comment'];
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement