Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 101
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
 
 
Register now for full access!
Old 08-29-2009, 03:52 PM Re: Why is this code giving this error?
NullPointer's Avatar
Will Code for Food

Posts: 2,781
Name: Matt
Location: Irvine, CA
Trades: 0
You're missing a closing brace }
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-29-2009, 03:56 PM Re: Why is this code giving this error?
Super Talker

Posts: 101
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:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
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 offline
Reply With Quote
View Public Profile
 
Old 08-29-2009, 04:11 PM Re: Why is this code giving this error?
Super Talker

Posts: 101
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.29310 seconds with 12 queries