Ok here's my code thus far. I'm just trying to do a basic query to get the exp from the previous level that i've already recorded. Now for some reason PHP is giving me this error upon the 11th row. So i've included here all code up until then. "Parse error: parse error in C:\wamp\www\tester\ExpCalculator.php on line 11"
<?php
(int)$CL = $_POST['Level'];
$dbhost = 'localhost';
$dbuser = 'user';
$dbpass = 'pass';
$dbname = 'various_values';
if ($CL <= 120) {
$conn = mysql_connect($dbhost,$dbuser,$dbpass)
or die ('ERROR CONNECTING');
mysql_select_db($dbname);
$query = sprintf("SELECT EXP FROM xp WHERE id = ($CL-1)"),
$PXP = mysql_query($query);
After looking over my code i find nothing wrong with it. The only thing i can think of is that it's trying to "auto-run" the code w/o any input as ther'es nothing currently in the "level" form later on in the code. The main thing that's confusing me is why it's still trying to "auto-run" i thought it'd do nothing if something's not there. Should i add some sort of thing to stop it from going?