Jump to content

Get Total Columns from table in mysql


vijay

Recommended Posts

Hi.. Is there any way in mysql to get total no. of columns from specific table..?you have to not use: mysql_num_fields($result);want to say any special query... or mysql function..Regards,Vijay Prajapati.

Link to comment
Share on other sites

well, you could try and do this:

<?php$query = mysql_query("SELECT * FROM `table`");while($row = mysql_fetch_assoc($query)){echo count($row)."<br />";}?>

That should print the no of columns a bunch of times. Thats as close as I can come..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...