SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Atlanta
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to validate a page

    HI everyone,

    I need to validate the columns which contains a null value. Right now every time I enter the record, the columns has the '0' as there null value. And when I need an average for that column it devides the total of column with all the rows in the database instead of only the rows has the value. Because It assigns the '0' for the empty rows or the null value, and count them.

    The column description is:

    column_name char(2) YES NULL

    Help me
    Aneal
    Aneal

  2. #2
    SitePoint Member
    Join Date
    May 2001
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Alex Alexapolsky

    do you use php ?
    try to iterate through resultset given by your query ,
    like "select filed from table" (not SUM!)
    and check every field for null value , if not null
    add it to $total variable.
    Alex
    Certified CodeCharge Developer
    Develop database-connected web sites
    without coding: http://www.codecharge.com
    ASP, ASP.NET, PHP, JSP, Perl, ColdFusion

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Atlanta
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Alex
    Aneal


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •