Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
getting number of coloums from a table
Old 02-10-2007, 01:58 PM getting number of coloums from a table
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
Hi

I know that in mysql you can retrieve the number of rows from a table by using numrow, but is there a command that will count the number of columns?

My table has a varying number of columns and i need to loop through those columns in a specific row.

Any help much appreciated

Mark
hiptobesquare is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-10-2007, 06:59 PM Re: getting number of coloums from a table
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
I know one way to count the number of columns returned from each row is do a count of array elements from the returned row. Depending on the language you use, this will be a different method.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 02-11-2007, 05:57 PM Re: getting number of coloums from a table
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
by "table" do you mean the recordset returned from the query? or are you creating temporary tables "on the fly"
Other than that, tables have a set number of columns normally determined at DB design time.

BTW there is no MySQL function for "numrow" , there is a PHP function of mysql_num_row if that is what you are meaning.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to getting number of coloums from a table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26705 seconds with 12 queries