Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost"; // Host naam
- $username="root"; // Mysql login naam
- $password=""; // Mysql wachtwoord
- $db_name="marketplace"; // Database naam
- $tbl_name="stageplek"; // Table naam
- // Verbinding maken met de server en de database selecteren.
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $sql="SELECT * FROM $tbl_name ORDER BY id ASC";
- // OREDER BY id ASC is het orderen van de id's van laag naar hoog.
- $result=mysql_query($sql);
- ?>
- <table width="40%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td width="6%" align="center" bgcolor="#E6E6E6"><strong>#</strong></td>
- <td width="34%" align="center" bgcolor="#E6E6E6"><strong>Titel</strong></td>
- </tr>
- <?php
- while($row = mysql_fetch_array($result))
- {
- echo "<tr>";
- echo "<td>" . $row['id'] . "</td>";
- echo "<td>" . $row['titel'] . "</td>";
- echo "<td><a href=\"view_topic.php?id= . $row['id'] . \"> . $row['titel']; .</a></td>";
- echo "</tr>";
- }
- echo "</table>";
- ?>
- <table align="center" >
- <tr>
- <td colspan="5" align="center" bgcolor="#E6E6E6"><a href="topic_maken.php"><strong>Create New Topic</strong> </a></td>
- </tr>
- </table>
- gives the error:
- Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\Forum\forum_index.php on line 28
- The line that doesnt work:
- echo "<td><a href=\"view_topic.php?id= . $row['id'] . \"> . $row['titel']; .</a></td>";
- Need to show the topic title and that u can click on it. It will take you to a page with that topic title id.
Add Comment
Please, Sign In to add comment