Jump to content

[SOLVED] unexpected T_VARIABLE Prob Simple Fix


winmastergames

Recommended Posts

Well I keep getting this error when i try to put a Variable heres the code:

<?php
// connect to db
// select db
$db_host = "$host";
$db_username = "$username";
$db_password = "$password";
$db_name = "$name";
$tha1 = "$tah1";
$retrive1 = "$ret1";
$retrive2 = "$ret2";
$retrive3 = "$ret3";
$retrive4 = "$ret4";
$retrive5 = "$ret5";
$retrive6 = "$ret6";
$conn = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_name, $conn) or die("Error 103: MYSQL CONNECT");

$myquery = mysql_query("select * from $SS1db ORDER BY $defaultsortby $sorttype") or die("Error 103: MYSQL CONNECT");
while($row = mysql_fetch_array($myquery)){
extract($row);
echo"
<tr>
	<td>$datetime</td>
	<td>$whtotal</td>
	<td>$tha1</td>
</tr>";
}
$retrive1 //Retrive 1
//$retrive2 //Retrive 2
//$retrive3 //Retrive 3
?>

If you look at the bottom at //$retrive2 and //$retrive3 When i uncomment them it brings up this error:

Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\Projects\MeterWebsiteReader\NewCSSScroller\SS1.php on line 333

When you uncomment them im proberly just being dumb but i cant figure out problem

Please and Thank you :)

forgot a semicolon (or 3)

<?php
// connect to db
// select db
$db_host = "$host";
$db_username = "$username";
$db_password = "$password";
$db_name = "$name";
$tha1 = "$tah1";
$retrive1 = "$ret1";
$retrive2 = "$ret2";
$retrive3 = "$ret3";
$retrive4 = "$ret4";
$retrive5 = "$ret5";
$retrive6 = "$ret6";
$conn = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_name, $conn) or die("Error 103: MYSQL CONNECT");

$myquery = mysql_query("select * from $SS1db ORDER BY $defaultsortby $sorttype") or die("Error 103: MYSQL CONNECT");
while($row = mysql_fetch_array($myquery)){
extract($row);
echo"
<tr>
	<td>$datetime</td>
	<td>$whtotal</td>
	<td>$tha1</td>
</tr>";
}
$retrive1; //Retrive 1
$retrive2; //Retrive 2
$retrive3; //Retrive 3
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.