![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Aug 2004
Posts: 913
|
a little help with a mysql query, please.
Is it possible to count the total number of fields in a table that are empty? If so, please let me know, I cant find anything in the manual.
__________________
Sig for sale. ICQ: 163-545-054 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2005
Location: Costa Rica
Posts: 465
|
yes.
select count(*) from table_name where field1 isNULL and field2 isNULL and ...; or if the fields are empty as in (they were set empty by code): select count(*) from table_name where field1 = '' and field2 = '' and ...; i don't know of any built-in mysql function that will help, due to the fact of varying structure of tables. peace
__________________
-- "You can't stop ingenuity, trust me.." ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Aug 2005
Location: Costa Rica
Posts: 465
|
ooops, nevermind.
that just returns the number of records with "empty" fields.. not what you wanted. ![]()
__________________
-- "You can't stop ingenuity, trust me.." ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Join Date: Aug 2004
Posts: 913
|
Quote:
__________________
Sig for sale. ICQ: 163-545-054 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Aug 2004
Posts: 913
|
ah, yeah I just noticed that now. It actually is what I need, but this couints tyhe entire database, enstead of a specific column. I need the blank fields in USERS where id=x
__________________
Sig for sale. ICQ: 163-545-054 |
![]() |
![]() ![]() ![]() ![]() ![]() |