unexpected $ on line 88

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:

unexpected $ on line 88

Post by CoolAsCarlito »

Someone know what my error is.

Code: Select all

 
<?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 *, DATE_FORMAT(`datecreated`, '%M %e, %Y') as datecreated FROM titlehistory";
 
if ($r = mysql_query ($query)){ // Run the query. 
    while ($row = mysql_fetch_array ($r)){
 
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar4.gif" height=35>&nbsp;<font color="white">Title Histories</font></td></tr>';
print '<tr><td></td></tr>';
print '</table>';
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar3.gif" height=35 colspan=2><font color=red>&nbsp;KOW '.$row['titlename'].'</font></td></tr>';
print '<tr><td width=200><img src="/images/' . $row['titleimage'] . '" width=208px height=156px border=0 alt="View KOW '.$row['titlename'].' History"></td><td valign=top>';
print '<table cellpadding="2" cellspacing="0" border="0" width=100%>';
print '<tr><td align=center bgcolor=#E0E0E0><b>Date Created</b></td></tr><tr><td align=center><font color=white>'.$row['datecreated'].'</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Status</b></td></tr>';
print '<tr><td align=center><font color=white>'.$row['status'].'</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Longest Reign</b></td></tr>';
print '<tr><td align=center><a href=bio.php?'.$row['longestreign'].'><b>'.$row['longestreign'].'</b></a> <font color=white>('.$row['numdays'].')</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Most Successful Defenses</b></td></tr>';
print '<tr><td align=center><a href=bio.php?'.$row['sucessdefenses'].'><b>'.$row['sucessdefenses'].'</b></a> <font color=white>('.$row['numdef'].')</font></td></tr>';
print '</table>';
}
}
else
{
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar4.gif" height=35>&nbsp;<font color="white">Title Histories</font></td></tr>';
print '</table>';
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar3.gif" height=35 colspan=4>&nbsp;Active Titles</td></tr>';
print '<tr>';
 
//Define the query
$query = "SELECT * FROM titles WHERE status = 'Active'"; // Active rows
 
if ($r = mysql_query ($query)){ // Run the query. 
 
    while ($row = mysql_fetch_array ($r)){
    
        print '<td><a href="titlehistory.php?id=' . $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
        print '<img src="/images/' . $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
    
    }
 
} else {
    die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF 
 
print '</tr>';
print '</table>';
print '<img src=images/spacer.gif><br>';
print '<table border=0 cellspacing=0 cellpadding=3 width=575><tr><td background="images/bg_bar3.gif" height=35 colspan=2>&nbsp;Inactive Titles</td></tr>';
print '<tr>';
 
//Define the query
$query = "SELECT * FROM titles WHERE status = 'Inactive'"; // Inactive Rows
 
if ($r = mysql_query ($query)){ // Run the query. 
 
    while ($row = mysql_fetch_array ($r)){
    
        print '<td><a href="titlehistory.php?id=' . $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
        print '<img src="/images/' . $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
    
    }
 
} else {
    die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF 
 
print '</tr>';
print '</table>'; 
}  
?> 
 
filippo.toso
Forum Commoner
Posts: 30
Joined: Thu Aug 07, 2008 7:18 am
Location: Italy
Contact:

Re: unexpected $ on line 88

Post by filippo.toso »

You don't close the "if (isset($_GET['id']))" statement with a }
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Re: unexpected $ on line 88

Post by desmi »

You're missing one } at the end of the code..

(Too late ;))
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Re: unexpected $ on line 88

Post by CoolAsCarlito »

Thank you.
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Re: unexpected $ on line 88

Post by CoolAsCarlito »

Fixed. Thanks.
Post Reply