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> Quote Link to comment 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>"; Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.