winmastergames Posted June 8, 2008 Share Posted June 8, 2008 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 Link to comment https://forums.phpfreaks.com/topic/109211-solved-unexpected-t_variable-prob-simple-fix/ Share on other sites More sharing options...
jonsjava Posted June 8, 2008 Share Posted June 8, 2008 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 ?> Link to comment https://forums.phpfreaks.com/topic/109211-solved-unexpected-t_variable-prob-simple-fix/#findComment-560238 Share on other sites More sharing options...
winmastergames Posted June 8, 2008 Author Share Posted June 8, 2008 Thanks I Forgot Proberly because those Comments were there they distracted me LOL! Link to comment https://forums.phpfreaks.com/topic/109211-solved-unexpected-t_variable-prob-simple-fix/#findComment-560240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.