Bracketology

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Bracketology

Post by CoolAsCarlito »

It appears I have a problem with my brackets because I'm getting a
Parse error: parse error, unexpected $ in /home/content/y/a/n/yankeefaninkc/html/bio.php on line 96.

And can someone tell me if there is anythign wrong with my get id part of my script.

Code: Select all

 
 
<?php echo "<body bgcolor=\"black\" text=\"black\" link=\"red\" vlink=\"red\">"; ?>
 
<?php
// Connects to your Database
$link = mysql_connect("?", "?", "?") or die(mysql_error());
mysql_select_db("?",$link) or die(mysql_error());
 
if (!mysql_select_db("?", $link)) {
echo 'Could not select database';
exit;
{
if (isset($_GET['id']))
 
//Define the query
$query = "SELECT * FROM bios WHERE id='".$_GET['id']."'";
 
if ($r = mysql_query ($query)){ // Run the query. 
 
 
print '<table border=0 cellspacing="0" cellpadding=3 width=100%>';
print '<tr>';
print '<td background="images/bg_bar4.gif" height=35><font color=white>&nbsp;Biography</font></td>';
print '</tr>';
print '</table>';
print '<img src=images/spacer.gif><br>';
print '<table border=0 cellpadding=0 cellspacing=0 width=100%>';
print '<tr>';
print '<td width=450><img src=images/' . $row['wrestlername'] . '></td>';
print '<td valign=top>';
print '<table border=0 cellspacing="0" cellpadding=3 width=100%>';
print '<tr>';
print '<td background="images/bg_bar3.gif" height=35><font class=headline>&nbsp;Overall Match Record</font></td>';
print '</tr>';
print '<tr>';
print '<td bg color=#EEEEEE>';
print '<table border=0 align=center>';
print '<tr>';
print '<td align=center><font class=big color=white>' . $row['wins'] . '</font></td>';
print '<td align=center><font class=big color=white>-</font></td>';
print '<td align=center><font class=big color=white>' . $row['losses'] . '</font></td>';
print '<td align=center><font class=big color=white>-</font></td>';
print '<td align=center><font class=big color=white>' . $row['draws'] . '</font></td>';
print '<tr>';
print '<td align=center><font class=normal color=white>WINS</font></td>';
print '<td align=center></td>';
print '<td align=center><font class=normal color=white>LOSSES</font></td>';
print '<td align=center></td>';
print '<td align=center><font class=normal color=white>DRAWS</font></td>';
print '</tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
print '<table border=0 cellspacing="0" cellpadding=3 width=100%>';
print '<tr>';
print '<td></td>';
print '</tr>';
print '<tr>';
print '<td><img src="images/spacer.gif" height="5"><img src="images/spacer.gif" height="5"><img src="images/spacer.gif" height="5"></td>';
print '</tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
print '<img src=images/spacer.gif><br>';
print '<table border=0 cellspacing="0" cellpadding=3 width=100%>';
print '<tr>';
print '<td background="images/bg_bar3.gif" height=35><font class=headline>&nbsp;Wrestler Information</font></td>';
print '</tr>';
print '<tr>';
print '<td bgcolor="#EEEEEE" width=100%>';
print '<table border=0 cellpadding=0 cellspacing=0 width=100%>';
print '<tr>';
print '<td width=100%><img src=images/bio/alexgrey.jpg align=right><font class=normal><b><font color=666666>Name:</font></b><br>' . $row['wrestlername'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Nicknames:</font></b><br>' . $row['nicknames'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Birth Date:</font></b><br>' . $row['birthdate'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Height:</font></b><br>' . $row['height'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Weight:</font></b><br>' . $row['weight'] . ' pounds<br><img src=images/spacer.gif><br><b><font color=666666>Hometown:</font></b><br>' . $row['hometown'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Nationality:</font></b><br>' . $row['nationality'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Ethnicity:</font></b><br>' . $row['ethnicity'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Favorite Quote:</font></b><br>' . $row['quotes'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Personality:</font></b><br' . $row['personality'] . '<br><img src=images/spacer.gif><br><b><font color=666666>Theme Music:</font></b><br>' . $row['thememusic'] . '</font></td>';
print '</tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
print '<img src=images/spacer.gif><br>';
print '<table border=0 cellspacing="0" cellpadding=3 width=100%>';
print '<tr>';
print '<td background="images/bg_bar3.gif" height=35><font class=headline>&nbsp;Biography</font></td>';
print '</tr>';
print '<tr>';
print '<td bgcolor="#EEEEEE"><img src=images/body/alexgrey.jpg hspace="5" vspace="5" border="0" width="300" height="625" align=right><div style="text-align:justify">Non' . $row['biography'] . '</div></td>';
print '</tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
print '<img src="images/spacer.gif" height="8">';
}
}
?>
 
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Bracketology

Post by jayshields »

You've got 3 opening curly brackets and 2 closing ones. Your editor should be pointing out errors like these. It's likely you've messed up by putting an opening bracket after exit instead of a closing one and then missed out an opening bracket after your if isset $_GET['id'] statement.
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Re: Bracketology

Post by CoolAsCarlito »

Alright now it's back to showing the actual page however now it won't post the data into it. I'm thinking something is wrong with my get id but I don't know.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Bracketology

Post by jayshields »

You'll want to change $r to $row or vice versa. Haven't you got error_reporting set to something higher than default for when your code is in production? This should be triggering warnings.
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Re: Bracketology

Post by CoolAsCarlito »

Still don't have it posting the data. Anyone else have any other ideas.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Bracketology

Post by califdon »

Have you done what jayshields suggested? If so, what was the result?

When you seem to ignore suggestions from us, we tend to stop trying to help you.
Post Reply