Page 1 of 1

mssql function call from php script

Posted: Wed Apr 04, 2007 1:14 pm
by kingdbag
Hey folks,

Is there a mssql function call to return what fields are in the database you're connected to? I can't seem to find it on google..(if there is one..but im sure there is)

I don't want the data just field names.

Posted: Wed Apr 04, 2007 1:44 pm
by Mordred
google says:

Code: Select all

select * from syscolumns where id = object_id('table_name_here')

Posted: Wed Apr 04, 2007 1:46 pm
by kingdbag
.....google says..... you are making me look bad!!!!

thanks I will try this out

Posted: Thu Apr 05, 2007 2:55 am
by Mordred
kingdbag wrote:.....google says..... you are making me look bad!!!!
Sorry, I didn't mean to :(
I am just pointing it out as a disclaimer, because I haven't written a single line of MSSql ;) This is something I've seen from SQL injection papers, not something I've actually used.