Log in

No account? Create an account
heart + stomach
Advancing the sum total of human knowledge and endeavour!
PhP/Wordpress help? 
1st-Mar-2008 12:40 pm

So I'm busy working on the website for the Greek's band De Profundis (isn't it sexy?), but I keep getting the following error message on blog posts / gig pages:

WordPress database error: [Unknown column 'p.ID' in 'IN/ALL/ANY subquery']

SELECT ID, post_title FROM wp_posts WHERE post_date < '2008-02-21 21:29:06' AND post_type = 'post' AND post_status = 'publish' AND p.ID NOT IN (SELECT postID FROM wp_gigs_gig) ORDER BY post_date DESC LIMIT 1
I've tried the Wordpress support forum, but no one's replied yet, and I have NO IDEA how to interpret that error message.

Hlp plz?
1st-Mar-2008 01:26 pm (UTC)
In your "where" clause you have:

... and p.ID NOT IN (SELECT etc...

Remove the "p." as you've not associated the "p" with the table wp_posts in your "from" clause.

Give me a yell if you need/want more explanation..
1st-Mar-2008 01:43 pm (UTC)

Uh, I don't suppose you'd have any idea which file this'd be in?
2nd-Mar-2008 05:51 am (UTC)
You can probably just search the wp installation for a bit of that string.
2nd-Mar-2008 09:45 am (UTC)
There are a lot of .php files in the WP installation, and I haven't the slightest idea which one I should be searching, other than opening them all individually in notepad and looking manually.
3rd-Mar-2008 01:30 am (UTC)
If they're on your hard drive, you can just use the Windows search thing to search for text within files.

If they're only on a server but you have SSH access, grep -riI 'SELECT ID, post_title FROM wp_posts' *
3rd-Mar-2008 04:57 pm (UTC)
No dice, so far. But you've been infinitely more helpful that the buggers on the WP support forum. Thank you.
4th-Mar-2008 01:30 am (UTC)
Ehh. Try different bits of the query? It could be a string built in pieces by the code.
This page was loaded Jan 17th 2019, 3:05 am GMT.