The page in question is http://shawntc.x10hosting.com/picard-page.php
I'm learning to use PHP/SQL. Pretty much what I'm trying to do is grab an integer value from a database, then when the user clicks a button the value is incremented and stored. The PHP on the server that deals with the SQL:
But when I press Add to Picard, this is what is returned:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/shawntc/public_html/add-picard-starships.php on line 15
Grrr it makes no sense to me.
I'm learning to use PHP/SQL. Pretty much what I'm trying to do is grab an integer value from a database, then when the user clicks a button the value is incremented and stored. The PHP on the server that deals with the SQL:
Code:
<?php
// add-picard-starships.php
$a=$_POST["a"];
$a++;
$con=mysql_connect("localhost","shawntc_username","wouldntyouliketoknow");
if(!$con){
die("Connect failed".mysql_error());
}
mysql_select_db("shawntc_test",$con);
mysql_query("UPDATE StarshipTest SET StarshipsOwned='$aString' WHERE Captain='Picard'");
$result=mysql_query("SELECT StarshipsOwned FROM StarshipTest WHERE Captain='Picard');
$row=mysql_fetch_array($result);
echo $row['StarshipsOwned'];
mysql_close($con);
?>
But when I press Add to Picard, this is what is returned:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/shawntc/public_html/add-picard-starships.php on line 15
Grrr it makes no sense to me.
Last edited: