x

get column name and view it using php

hello Please can you help me about how can I get column name from database and view it using php I find this

SELECT COLUMN_NAME FROM information_schema.columns WHERE table_name = 'mohamad' ORDER BY ordinal_position


but I don't know how I can view result with php..

this problem take alot of time and it is not solvet yet... thank you very much

more ▼

asked Dec 14, 2014 at 04:32 PM in Default

avatar image

mhd.hamouday
1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Which version of sql server you are using? If its 2008 and above you can read it from sys.columns table.

You can filter it for the table you need all the columns for by specifying

 OBJECT_ID('your_table_name_here')

I am not expert in PHP so can't help displaying it on that.

more ▼

answered Dec 15, 2014 at 11:27 AM

avatar image

VishalhSingh
851 3 6

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x28
x11
x9
x5
x3

asked: Dec 14, 2014 at 04:32 PM

Seen: 93 times

Last Updated: Dec 15, 2014 at 11:27 AM

Copyright 2017 Redgate Software. Privacy Policy