Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Parse and T_String errors?
Old 09-21-2005, 06:16 PM Parse and T_String errors?
Junior Talker

Posts: 1
Trades: 0
okay im just starting to learn PHP/MySQL... and I got this code from a book im reading to test and see if my SQL database is active... now i got it in alright but wheni go to the page it returns this error

Parse error: parse error, unexpected '>' in /home/yeuakon/public_html/mysql_up.php on line 16

and when i remove the <b></b> tags it gives me a "unexpected T_STRING" on line 16...

is there something wrong?

heres my code

Code:
<html>
<head>
<title>Test MySQL</title>
<body>
<!-- mysql_up.php -->
<?php
$host="localhost";
$user="yeuakon_smf1";
$password="";
mysql_connect($host,$user,$password);
$sql="show status";
$result = mysql_query($sql);
if($result == 0)
  echo("<b>Error " . mysql_errno() . ": " . mysql_error() . " </b>);
elseif (mysql_num_rows($result) == 0)
  echo ("<b>Query executed successfully!</b>");
else{
?>
<!-- Table that displays the results -->
<table border="1">
<tr><td><b>Variable_name</b></td><td><b>Value</b></td></tr>
<?php
for ($i=0;$i<mysql_num_rows($result);$i++){
  echo("<TR>");
  $row_array = mysql_fetch_row($result);
  for($j=0;$j<mysql_num_fields($result);$j++)
    echo("<TD>" . $row_array[$j] . "</td>");
    }
    echo("</tr>");
}
?>
</table>
<?php } ?>
</body>
</html>
Sequalit is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Parse and T_String errors?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.60814 seconds with 12 queries