Note that there are some explanatory texts on larger screens.

plurals
  1. POParse error: syntax error, unexpected end of file in
    text
    copied!<p>I have been trying to create a website for a group, but I ran into some error I don't seem to be able to fix myself. My question is if some of you can find what I am doing wrong, I've been looking and cant seem to find anything left open or anything simular. </p> <p>Thanks in advance</p> <pre><code>&lt;?php session_start(); //Loading template power include_once("../attritiongaming/tpl/class.TemplatePower.inc"); //Linking templatepower to html $tpl = new TemplatePower("test.html"); //Connecting to database $db = new PDO('mysql:host=localhost;dbname=attritiongaming','root', 'solidusaphm8932'); $db -&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $tpl-&gt;assign("name", "Jessey"); //Echo tables echo "&lt;table border='1'&gt; &lt;tr&gt; &lt;th&gt;ID&lt;/th&gt; &lt;th&gt;firstname&lt;/th&gt; &lt;th&gt;lastname&lt;/th&gt; &lt;th&gt;username&lt;/th&gt; &lt;th&gt;emailadress&lt;/th&gt; &lt;th&gt;edit&lt;/th&gt; &lt;th&gt;remove&lt;/th&gt; &lt;/tr&gt;"; //defining page $page = isset($_GET['action']) ? $_GET['action'] : ''; //Start switch for page switch ($page) { case 'edit'; $tpl-&gt;newBlock("edit"); try { $db = new PDO('mysql:host=localhost;dbname=attritiongaming','root', 'solidusaphm8932'); $db -&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql ="UPDATE members SET firstname='firstname' WHERE firstname='jessey'"; //Secure with PDO $stmt = $db-&gt;prepare($sql); $stmt-&gt;bindParam(':firstname', $firstname, PDO::PARAM_STR); $stmt-&gt;bindParam(':lastname', $lastname, PDO::PARAM_STR); $stmt-&gt;bindParam(':username', $username, PDO::PARAM_STR); $stmt-&gt;bindParam(':emailadress', $emailadress, PDO::PARAM_STR); $stmt-&gt;bindParam(':password', $password, PDO::PARAM_STR); //execute sql query $stmt-&gt;execute(); } //Catch errors and show them. catch(PDOException $e) { echo '&lt;pre&gt;'; echo 'line '.$e-&gt;getLine().'&lt;br&gt;'; echo 'file'.$e-&gt;getFile().'&lt;br&gt;'; echo 'Error'.$e-&gt;getMessage(); echo '&lt;/pre&gt;'; } default: $tpl-&gt;newBlock("default"); if (isset($_POST['search'])) { $tpl-&gt;assign("searchterm", $_POST['search']); } if (isset($_POST['searching'])) { $sql ="SELECT * FROM members WHERE username LIKE :search"; $stmt = $db-&gt;prepare($sql); $search = $_POST['search']. '%'; $stmt-&gt;bindParam(':search', $search, PDO::PARAM_STR); $stmt-&gt;execute(); } while ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) { $tpl-&gt;newBlock(""); } $sql= "SELECT * FROM members"; $stmt=$db-&gt;prepare($sql); $stmt-&gt;execute(); //Loop show all members while($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;" . $row['ID'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['firstname'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['lastname'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['username'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['emailadress'] . "&lt;/td&gt;"; echo "&lt;td&gt; &lt;a href='?action=edit&amp;id=".$row['ID']."'&gt;Edit&lt;/a&gt;&lt;/td&gt;"; echo "&lt;td&gt; &lt;a href='?action=remove&amp;id=".$row['ID']."'&gt;Remove&lt;/a&gt;&lt;/td&gt;"; echo "&lt;/tr&gt;"; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload