Jump to content

how to...


AdrianR

Recommended Posts

[!--quoteo(post=353715:date=Mar 10 2006, 03:55 PM:name=adrianR)--][div class=\'quotetop\']QUOTE(adrianR @ Mar 10 2006, 03:55 PM) [snapback]353715[/snapback][/div][div class=\'quotemain\'][!--quotec--]
People how can I get the number of field in a table?
[/quote]

mysql_num_fields -- Get number of fields in result
[a href=\"http://www.php.net/mysql_num_fields\" target=\"_blank\"]http://www.php.net/mysql_num_fields[/a]

to get the number of columns in a table:
[code]$query = "SHOW COLUMNS FROM tablename";
$result = mysql_query($query);
$colcount = mysql_num_rows($result);
[/code]

[!--quoteo(post=353715:date=Mar 10 2006, 03:55 PM:name=adrianR)--][div class=\'quotetop\']QUOTE(adrianR @ Mar 10 2006, 03:55 PM) [snapback]353715[/snapback][/div][div class=\'quotemain\'][!--quotec--]
and how can i get the number of entrys in a field?
[/quote]

Not sure what you mean.

You could do an sql query:
[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] [color=blue]COUNT[/color](fieldname) [color=green]FROM[/color] [color=orange]tablename[/color] [color=green]WHERE[/color] fieldname ![color=orange]=[/color] NULL [color=blue]AND[/color] fieldname ![color=orange]=[/color] "" [!--sql2--][/div][!--sql3--]

[!--quoteo(post=353715:date=Mar 10 2006, 03:55 PM:name=adrianR)--][div class=\'quotetop\']QUOTE(adrianR @ Mar 10 2006, 03:55 PM) [snapback]353715[/snapback][/div][div class=\'quotemain\'][!--quotec--]
thanks in advance:)
[/quote]

Your welcome, afterward.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.