What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » What's wrong with this SQL?

What's wrong with this SQL?
Author: Message:
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
30 / Male / Flag
Joined: Oct 2006
O.P. Shocked  What's wrong with this SQL?
I am trying to find the url of the latest 'published' wordpress 'post':
code:
SELECT guid FROM wp_posts WHERE post_status='publish' AND post_type='post' ORDER BY post_date_gmt DESC LIMIT 1
It returns this error
quote:
Originally posted by mySQL

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/****/*******/******/************.php on line 666
Could mean empty result set?
I removed 'LIMIT 1' and it returned a list of post url's sorted just how I want.
I also tried:
code:
SELECT guid FROM wp_posts WHERE post_status='publish' AND post_type='post' ORDER BY post_date_gmt DESC LIMIT 0,1
No luck! :sad:
Rep
UPDATE: I just read john-t's thread and it seems we are having the same problem, something to do with LIMIT.

This post was edited on 01-04-2008 at 03:55 AM by Baggins.
01-04-2008 03:47 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
What's wrong with this SQL? - by Baggins on 01-04-2008 at 03:47 AM
RE: What's wrong with this SQL? - by MeEtc on 01-04-2008 at 04:01 AM
RE: What's wrong with this SQL? - by Baggins on 01-04-2008 at 04:02 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On