Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "pass";
- $dbname = "SchoolBooking";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- ?>
- //usually have connect info in different file
- <?php
- Include('../connect.php');
- $sql = "SELECT password ................sql stuff";
- $result = $conn->query($sql);
- if($result->num_rows > 0){
- while($row = $result->fetch_assoc()){
- echo $row["password"]; #field name
- }
- }else{
- #no results
- }
- ?>
Add Comment
Please, Sign In to add comment