Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

php guestbook -parse error!! :O

Codes here !

Moderators: macek, egami, gesf

php guestbook -parse error!! :O

Postby php-punk » Wed Feb 19, 2003 1:29 pm

rite so far i have the following code
Code: Select all
<?
//display the stats in a table

//connect to the DB
$Connect=mysql_connect(localhost,***,***) or die("Sorry, unable to connect to DataBase(1)");

//select DB
$DB=mysql_select_db(database,$connect);

//setting the query in a variable, the query, in this case it SELECTS teh table and outputs int a HTML table
$query="select * FROM adamgb";
//running the actual query
$result=mysql_query($query) or die("Sorry, unable to query DataBase(2)");

//rows return?
$returned=mysql_num_rows($result);

echo("<b>Straight to the Point</B> Guestbook")

//fetch results and display in HTML table
echo("<b>$returned results</B>");
      
      //putting the results into a Array
      while($row=mysql_fetch_array($result))
         //looping thru the array and outputing the results into a table
         {
echo("<p>&</p>")
echo("<table border=\"0\" celpadding=\"5\" cellspacing=\"5\">")
echo("<tr>")
echo("<td width="81" bgcolor=#C6EFF7 >&.$row[&name&].&</td>")
echo("<td width="641" bgcolor=#C6EFF7><div align="left">&.row[Date&].&</div></td>")
echo("</tr>")
   
  echo("<tr>");
    echo("<td BGCOLOR=#EOEOEO><p>&.$row[&email&].&</p><p>&.$row[&website&].&</p></td>")
    echo("<td bgcolor=#EOEOEO>&.$row[Comments]&.&</td>")
  echo("</tr>")
          }
 
  echo("</table><p>"); </p>
            
//cleaing up the memory
mysql_free_result($result); </p>
?>


but im getting a parse error on line 21 it is telling me it expects:
`','' or `';'' but i cant see where or why it would go in?! can anywould help me!?
Last edited by php-punk on Thu Feb 20, 2003 2:51 am, edited 1 time in total.
php-punk
New php-forum User
New php-forum User
 
Posts: 60
Joined: Sun Feb 02, 2003 2:10 am
Location: Leeds, Uk

Postby Redcircle » Wed Feb 19, 2003 10:00 pm

you should have a semi-colin after every statement. You are missing a bunch of them.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Oleg Butuzov » Wed Feb 19, 2003 11:20 pm

1) at the next time dont publish your login and password.
every body can hack your site.
2) parser error? is the was a line number? can you tell as this info to us...

3) echo "<b><font size=1>WORK</font></b>"; - as you see you dont need " () - chars....
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby php-punk » Thu Feb 20, 2003 9:52 am

thx guys, i got it working, it was the semi's that it wanted, cudn't see!!!
php-punk
New php-forum User
New php-forum User
 
Posts: 60
Joined: Sun Feb 02, 2003 2:10 am
Location: Leeds, Uk


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron