Reply
Why is this code giving this error?
Old 08-29-2009, 03:26 PM Why is this code giving this error?
Skilled Talker

Posts: 83
Trades: 0
Hi guys,

I don't know PHP so I got someone to write this code for me:

PHP Code:
<?php
    $query_string 
'
        SELECT *,name FROM '
.$wpdb->prefix.'term_taxonomy
        JOIN '
.$wpdb->prefix.'terms
        ON '
.$wpdb->prefix.'term_taxonomy.term_id = '.$wpdb->prefix.'terms.term_id
        WHERE '
.$wpdb->prefix.'term_taxonomy.taxonomy = "post_tag" and '.$wpdb->prefix.'terms.name like '."'A%'".'    ORDER      by  '.$wpdb->prefix.'terms.name ASC ';

    
$post_tags $wpdb->get_results($query_string);
    
?>
    <div class="abc">
        <ul>
    <?php
    
foreach($post_tags as $key => $tag) {
        
$newletter substr($tag->name01);
        if(
$newletter !== $letter && $key != 0) { ?>
        </ul>
    </div>
    <?
}
?>
But it gives the following error:

HTML Code:
Parse error:  syntax error, unexpected $end
Could someone please fix the syntax or whatever it is that's wrong so it doesn't give the error any more.
Towhid is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-29-2009, 03:52 PM Re: Why is this code giving this error?
NullPointer's Avatar
Will Code for Food

Latest Blog Post:
Easy PHP Search with Opera
Posts: 1,069
Name: Matt
Location: Irvine, CA
Trades: 0
You're missing a closing brace }
__________________
Tinsology | How to Post Code | EverythingDev
NullPointer is online now
Reply With Quote
View Public Profile
 
Old 08-29-2009, 03:56 PM Re: Why is this code giving this error?
Skilled Talker

Posts: 83
Trades: 0
Quote:
Originally Posted by NullPointer View Post
You're missing a closing brace }
Stupid question: but where should I put the closing brace (this is how clueless I am about PHP)...
Towhid is offline
Reply With Quote
View Public Profile
 
Old 08-29-2009, 04:08 PM Re: Why is this code giving this error?
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Converting Video For YouTube
Posts: 2,556
Name: Keith Marshall
Location: West Hartford, CT
Trades: 0
Quote:
Originally Posted by Towhid View Post
Stupid question: but where should I put the closing brace (this is how clueless I am about PHP)...
Between the last ending } and ?>, so it should look like this:

}
}
?>
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is online now
Reply With Quote
View Public Profile
 
Old 08-29-2009, 04:11 PM Re: Why is this code giving this error?
Skilled Talker

Posts: 83
Trades: 0
Great, it works now! Thanks to both of you
Towhid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Why is this code giving this error?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.13240 seconds with 13 queries