TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 280
  • Total: 280

Parse error: syntax error, unexpected '}'

Started by DJ Skott, April 11, 2008, 10:35:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJ Skott

im getting

Parse error: syntax error, unexpected '}' in /home/xxxx/public_html/xxxx/board/Sources/Load.php(1743) : eval()'d code(35) : eval()'d code on line 1


when trying to use this code in a PHPBlock


<? require("configreq.php");

$stamp = mktime(0,0,0,date('m')-$requestdays,date('d'),date('Y'));
$now = date('Y-m-d H:i:s',$stamp);

//Handle different types of databases' special needs
switch($db->login["Type"])
{
  case "ibase" : $orderby = "ORDER BY count(songlist.ID) DESC"; break;
  case "mysql" :
  default      : $orderby = "ORDER BY cnt DESC"; break;
}
 
$now = $db->FormatTimestamp($now);
$db->open("SELECT songlist.ID, songlist.title, songlist.artist, count(songlist.ID) as cnt
            FROM requestlist, songlist
WHERE   (requestlist.songID = songlist.ID) AND
        (requestlist.code=200) AND
(requestlist.t_stamp>=$now)
GROUP BY songlist.ID, songlist.artist, songlist.title
$orderby",10);

if($db->num_rows()>0)
{


function PutRow($song)
{
global $i;
Preparesong($song);


?>

     <font size="2" color="#003366"><small><? echo $i; ?>.
     <a href="javascript:songinfo(<? echo $song["songid"]; ?>)"><? echo $song["artist"]; ?></a></small></font> <font size="2" color="#9F9F9F"><small>(<? echo $song["cnt"]; ?>)</small></font><br>
<font size="2" color="#003366"><small>&nbsp;&nbsp;&nbsp;&nbsp;<? echo $song["title"]; ?></small></font><br>
   
<?}?>

<table width="100%" bgcolor="<? echo $lightrow; ?>" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="<? echo $darkrow; ?>"><td nowrap><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#555555">Top10 Requests</font></b></td></tr>
<tr><td nowrap>
<?
$i=0;
while($song = $db->row())
{
   $i++;
   PutRow($song);
}
?> 
</td></tr>
</table>
<br>
<?}?>



Any ideas why its failing?

JPDeni

#1
I know 100% why it's failing. When you use a php block or php article, you can't use the


<?


at the beginng and the


?>


at the end.


DJ Skott

I did that. sorry cut the code from the wrong screen.

JPDeni

Then post the code you're using and I'll see if I can figure it out.

Personally, I find it easier to debug code that is pure php and doesn't have html mixed in, but I'll give it a try.

DJ Skott

i actually got it, it was the way it was cutting and pasting now im in the midst of hacking code to match the proper directories. thanks for the look tho.

This website is proudly hosted on Crocweb Cloud Website Hosting.