Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dsn = 'mysql:host=localhost;dbname=;charset=UTF8';
- $username = '';
- $password = '';
- $options = array(
- PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
- );
- $dbh = new PDO($dsn, $username, $password, $options);
- $stmt = $dbh->query("SELECT * FROM nyhet ORDER BY id DESC LIMIT 3");
- while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
- echo '<div class="item"><div class="text">';
- echo "<h2>" .$row['overskrift']. "</h2>\n";
- echo '<p>' . $row['shortstory']. '</p>';y
- echo '<a href='index2.php?id=" .$row['id'] .''>Les mer</a>";
- echo '</div><img src="images/bg-sldier.png" alt="The Last of us"></div>';
- }
- ?>
- <b>Parse error</b>: syntax error, unexpected '}' in <b>/var/www/php/show_intro.php</b> on line <b>23</b><br />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement