Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have imported some tables from my online wordpress database to my local to work on.

However now I am getting some weird sql errors that I don't get online.

I can see that the code of the plugin I am working on has some references (aliases?) that don't appear to reference anything that I see when I do a search:

$result = $wpdb->get_row( 'SELECT re.*
                                    FROM ' . EVENT_ESPRESSO_RECURRENCE_TABLE . ' re
                                    INNER JOIN ' . EVENTS_DETAIL_TABLE . ' ed
                                    ON re.recurrence_id = ed.recurrence_id
                                    WHERE re.recurrence_id = ' . $recurrence_id .
                        ' ORDER BY ed.start_date ASC
                                    LIMIT 1', ARRAY_A );

What is table 're'? In re.recurrence_id?

share|improve this question
    
I can't see how this question serves any use to the community here, sorry voting to close (note: the constants refer to the table names, find them and you'll find what you're looking for). –  Mark Duncan Jul 26 '11 at 16:15
    
By constants do you mean what's written in caps or the part labelled 're'? –  redconservatory Jul 26 '11 at 16:33
add comment

1 Answer

up vote 2 down vote accepted

're' is the alias you give to EVENT_ESPRESSO_RECURRENCE_TABLE.

The error you're seeing is probably because the EVENT_ESPRESSO_RECURRENCE_TABLE constant isn't defined.

Do a var_dump( $wpdb->last_query ) just below that code to see the final SQL statement.

share|improve this answer
    
thanks, helps a lot! –  redconservatory Jul 26 '11 at 16:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.