Sure! Try this:

SELECT * 
FROM table
WHERE 1=2

-ms

----- Original Message ----- 
From: "Scott Teglasi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 10:42 PM
Subject: Getting an empty result set is what I want!


Hi all, this is Scotty.
 
I wanted to know if it's possible to have MySQL return a resultset even
though there are no results.  I want this so that I can retrieve field
information on each field that's in the query.  (field type, length,
etc).  I know I can use describe or show columns to get the table info,
however I want to be able to have my code pick out the field information
from just about any query you throw at it. (although some fairly simple
queries will be used with this code most of the time.)
 
I recall in oracle there was a way using rownumber = 0 to just retrieve
row 0, and I could read the field names.
 
I'm using PHP to write this.
 
Can anybody help?
 
Scotty
 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to