Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP+SQL scoreboard issue
    primarykey
    data
    text
    <p>So I have made a ScoreBoard system , But whenever My adding/updating code block runs it fetchs me a Parse error: syntax error, unexpected T_VARIABLE on the line that holds the mysqli_query(); line like if It's failing , Here's my code .</p> <pre><code>&lt;form method="post" action=""&gt; &lt;center&gt; &lt;font color="green"&gt;Your name Max length is 15&lt;/font&gt; &lt;input type="text" name="username" maxlength="15"&gt; &lt;input type="submit" name="submit" value="Submit"&gt; &lt;/center&gt; &lt;/form&gt; &lt;font color='red'&gt;&lt;center&gt; &lt;?php if (isset($_POST['username'])) { $link = mysqli_connect("host","user","pass","db") or die("Error " . mysqli_error($link)); // $getname = $_POST['username']; $getname = mysqli_real_escape_string($link,$_POST['username']); $percentage = "10"; $querycheck = ("SELECT * from scoreboard where name = $getname") $result = mysqli_query($link, $querycheck); if (mysql_num_rows($querycheck) &gt; 0) { $queryexist = ("UPDATE scoreboard set percentage = 20 where name = $getname"); $resultexist = mysqli_query($link, $queryexist); echo "&lt;center&gt;&lt;font color='green' size='2'&gt;Your score has been updated successfuly&lt;/font&gt;&lt;/center&gt;"; } else { $querydoesnt = ("INSERT INTO scoreboard (name,percent) VALUES ('$getname',$percentage)"); echo "&lt;center&gt;&lt;font color='green' size='2'&gt;Your name has been added to the scoreboard successfuly &lt;/font&gt;&lt;/center&gt;!"; } ?&gt; &lt;/font&gt;&lt;/center&gt; </code></pre> <p>It fetches me an error that apparently says that there's something wrong with my mysqli_query line , The first one though .</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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