Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Connection script in other file
- require_once("connect.php);
- $name = 'elvis';
- $stmt = $pdo-prepare(SELECT * FROM tableName WHERE name = :name LIMIT 1");
- $stmt->bindParam('name',$name);
- $stmt-execute();
- while($row = $stmt-fetch())
- {
- //DB Fieldnames in square brackets within the single quotes
- $name = $row['name'];
- $quote = $row['fav_quote'];
- //Variables here must match above
- echo "<b><i>$quote</i></b><br><p>$name</p>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement