andy6867 Posted September 1, 2011 Share Posted September 1, 2011 ->from('songlist', array('album', 'artist', 'date_added', 'picture', 'albumyear', 'cnt' => 'Count(*)')) Any ideas why I am getting the Parse Error? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/246174-parse-error-syntax-error-unexpected-t_object_operator/ Share on other sites More sharing options...
jamesxg1 Posted September 1, 2011 Share Posted September 1, 2011 Please post the code that handles this input. James. Quote Link to comment https://forums.phpfreaks.com/topic/246174-parse-error-syntax-error-unexpected-t_object_operator/#findComment-1264236 Share on other sites More sharing options...
andy6867 Posted September 1, 2011 Author Share Posted September 1, 2011 <style type="text/css"> <!-- body { background-color: #EAEFF4; } --> </style><?php include("config.php"); include("header.php"); echo "<table border='0' style='border:2px solid #AFB1B1' cellspacing='0' cellpadding='2'>"; echo " <tr bgcolor='#747272'>"; echo " <td colspan='2' background='images/dbluecell.gif'>"; echo " <p align='center'>"; echo " <font face='Verdana, Arial, Helvetica' size='2' color='#FFFFFF'>"; echo " <b>Recently Added Albums</b>"; echo " </font>"; echo " </td>"; echo " </tr>"; $select = $db->select() ->distinct(true); ->from('songlist', array('album', 'artist', 'date_added', 'picture', 'albumyear', 'cnt' => 'Count(*)')) ->where('songtype = ?', 'S') ->group(array('picture', 'album')) ->having('cnt > 1') ->order('date_added DESC') ->limit(20,0); $count = 1; $rows = $db->fetchAll($select); foreach($rows as $row) { $count++; if(($count % 2)== 0) { echo "<tr align='center'>"; echo " <td>"; echo " <img align=left src='../pictures/" . rawurlencode($row["picture"]) ."', width='200' height='200'>"; echo " <p align='left'>"; echo " <font face=Verdana color=#FFFFFF size=1><b>ALBUM: </b><a href='./playlist.php?name=Playlist&?letter=". $letter . "&artist=" . rawurlencode($row["artist"]) . "&album=" . rawurlencode($row["album"]) . "'>" . $row["album"] . "</a><font><br>"; echo " <font face=Verdana color=#FFFFFF size=1><b>ARTIST: <i><a href='./playlist.php?name=Playlist&?letter=". $letter . "&artist=" . rawurlencode($row["artist"]) . "'>" . $row["artist"] . "</a></i></font><br>"; echo " <font face=Verdana color=#FFFFFF size=1><b>RELEASED: </b></font><font face=Verdana color=red size=1><b>".$row["albumyear"]."</b></font><font face=Verdana color=#FFFFFF size=1><b> ADDED: </b></font><font face=Verdana color=red size=1><b>".substr($row["date_added"],5,2)."/".substr($row["date_added"],8,2)." </b></font>"; echo " </p>"; echo " </td>"; } else { echo " <td>"; echo " <img align=left src='../pictures/" . rawurlencode($row["picture"]) ."', width='200' height='200'>"; echo " <p align='left'>"; echo " <font face=Verdana color=#FFFFFF size=1><b>ALBUM: </b><a href='./playlist.php?name=Playlist&?letter=". $letter . "&artist=" . rawurlencode($row["artist"]) . "&album=" . rawurlencode($row["album"]) . "'>" . $row["album"] . "</a><font><br>"; echo " <font face=Verdana color=#FFFFFF size=1><b>ARTIST: <i><a href='./playlist.php?name=Playlist&?letter=". $letter . "&artist=" . rawurlencode($row["artist"]) . "'>" . $row["artist"] . "</a></i></font><br>"; echo " <font face=Verdana color=#FFFFFF size=1><b>RELEASED: </b></font><font face=Verdana color=red size=1><b>".$row["albumyear"]."</b></font><font face=Verdana color=#FFFFFF size=1><b> ADDED: </b></font><font face=Verdana color=red size=1><b>".substr($row["date_added"],5,2)."/".substr($row["date_added"],8,2)." </b></font>"; echo " </p>"; echo " </td>"; echo "</tr>"; } } echo "</table>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/246174-parse-error-syntax-error-unexpected-t_object_operator/#findComment-1264241 Share on other sites More sharing options...
tastro Posted September 1, 2011 Share Posted September 1, 2011 is this the whole error? or does the error return in which line the error happens too? Quote Link to comment https://forums.phpfreaks.com/topic/246174-parse-error-syntax-error-unexpected-t_object_operator/#findComment-1264244 Share on other sites More sharing options...
andy6867 Posted September 1, 2011 Author Share Posted September 1, 2011 Found it.... there was a ";" after the DISTINCT True line Quote Link to comment https://forums.phpfreaks.com/topic/246174-parse-error-syntax-error-unexpected-t_object_operator/#findComment-1264247 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.