Reply
Unexpected $- What is this?! an how can i fix it
Old 01-28-2005, 10:33 AM Unexpected $- What is this?! an how can i fix it
Super Talker

Posts: 121
I am getting this error, here is the code (line 64 is just at the bottom of the file)

PHP Code:
<?
if($_GET['archive'] == 'yes'){
    
$newsSql "SELECT * FROM news";
}else{
    
$newsSql 'SELECT * FROM news LIMIT 6';
}
$newsSql mysql_query($newsSql);
if(
mysql_num_rows($newsSql) == 0){
    echo 
'There are no news articles';
}else{
    
$writeDiv true;
    echo 
'<table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/news.gif" style="background-position:left; background-repeat:no-repeat;">';
    while(
$newsArray mysql_fetch_array($newsSql)){
        
//get category information
        
$cat mysql_query('SELECT * newscategory WHERE id = '.$newsArray['category']);
        
$cat mysql_fetch_array($cat);
        
$catImage $cat['image'];
        
$cat $cat['name'];
        
//get staf information
        
$staff mysql_query('SELECT * staff WHERE id = '.$newsArray['staffid']);
        
$staff mysql_fetch_array($staff);
        
$staffEmail $staff['email'];
        
$staff $staff['username'];
        
//modify date format
        
$date convertDate($newsArray['date']);
        echo
'
          <tr>
            <th colspan="2" scope="col"><div align="left">'
.$cat.'</div></th>
          </tr>
          <tr>
            <td colspan="2"></td>
          </tr>
          <tr>
            <td width="72" height="72" rowspan="2" align="left" valign="top">'
.$catImage.'</td>
            <td>'
.$title.'</td>
          </tr>
          <tr>
            <td>'
.$body.'</td>
          </tr>
          <tr>
            <td colspan="2"><div align="right" class="smallText">Posted by <a href="mailto:'
.$staffEmail.'">'.$staff.'</a> on '.$date.'</div></td>
          </tr>'
;
        if(
$writeDiv == true){
            echo 
'<div>';
        }
        
$writeDiv false;
    }
//end while loop
    
echo '</div>
        </table>'
;
    if(
mysql_num_rows($newsSql) > 1){
        echo 
'<div align="center"><label><a href="javascript:expandAndHide();">Expand</a></label>  
            <a href="index.php?page=default&archive=yes">Archive</a></div>'
;
    }
?>
vegancoder is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-28-2005, 10:51 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Can you post the exact text of the error as the PHP processing engine is spitting it out. Also, do you mean that the very last line in your listing is line 64?
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 01-28-2005, 11:33 AM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
your missing a closing bracket for this:
PHP Code:
if(mysql_num_rows($newsSql) == 0){ 
    echo 
'There are no news articles'
}else{ 
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 01-28-2005, 01:57 PM
Super Talker

Posts: 121
thanks alot i used to just re-write the script lol
vegancoder is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Unexpected $- What is this?! an how can i fix it
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11693 seconds with 12 queries