rxn155 Posted July 13, 2007 Share Posted July 13, 2007 i got this error: Parse error: parse error, unexpected '>' in /homepages/6/d209800063/htdocs/mysql_up.php on line 6 this is my code... havent had much luck with echo tags: <?php /* Program: mysql_up.php * Desc: Connects to MySQL Server and * outputs settings. */ echo “<html> <head><title>Test MySQL</title></head> <body>”; $host=”host”; $user=”mysqlaccount”; $password=”mysqlpassword”; $cxn = mysqli_connect($host,$user,$password); $sql=”SHOW STATUS”; $result = mysqli_query($cxn,$sql); if($result == false) { echo “<h4>Error: “.mysqli_error($cxn).”</h4>”; } else { /* Table that displays the results */ echo “<table border=’1’> <tr><th>Variable_name</th> <th>Value</th></tr>”; for($i = 0; $i < mysqli_num_rows($result); $i++) { echo “<tr>”; $row_array = mysqli_fetch_row($result); for($j = 0;$j < mysqli_num_fields($result);$j++) { echo “<td>”.$row_array[$j].”</td>\n”; } } echo “</table>”; } ?> </body></html> Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/ Share on other sites More sharing options...
teng84 Posted July 13, 2007 Share Posted July 13, 2007 use double quote echo "<html> <head><title>Test MySQL</title></head> <body>"; Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/#findComment-297067 Share on other sites More sharing options...
rxn155 Posted July 13, 2007 Author Share Posted July 13, 2007 arent those double quotes? i dont understand Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/#findComment-297073 Share on other sites More sharing options...
infid3l Posted July 13, 2007 Share Posted July 13, 2007 arent those double quotes? i dont understand Have you been coding in Microsoft Word or Abiword? Those aren't the type of quote that PHP needs. Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/#findComment-297075 Share on other sites More sharing options...
hackerkts Posted July 13, 2007 Share Posted July 13, 2007 You single and double quote looks funny, anyway, you could open php tag after you opened your body's tag. Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/#findComment-297076 Share on other sites More sharing options...
Northern Flame Posted July 13, 2007 Share Posted July 13, 2007 yea you inserted the wrong quotes, try using notepad Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/#findComment-297077 Share on other sites More sharing options...
hackerkts Posted July 13, 2007 Share Posted July 13, 2007 I wouldn't recommend him using notepad, try to get PHP editor, those software that specially made for writing php codes, they will highlight your code. In other words, you can spot any errors just by looking at the codes' colour. Link to comment https://forums.phpfreaks.com/topic/59763-solved-parse-error/#findComment-297082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.