Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    15
    Member #
    609
    Hello,

    If i have a table structure like in my attachment, how can i check for empty fields.That is, I want to check for every record in the table if lastname, street, zip, city and pwd are filled.

    For example, in the second record that is with id no:2, street and city are empty.Similarly for the next record with id no:3, lastname,zip and pwd are empty.

    So, idno:2 and idno:3 are incomplete.
    Now, what i would like to do is, if i press a button, i want to send an e-mail to the respective e-mails which are in idno:2 and idno:3 that they need to fill their information again.

    Could somebody please tell me how can i do this one?

    Thanks in advance
    Attached Images Attached Images

  2.  

  3. #2
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    Try this:

    PHP Code:
    $emptyFields;
    $sql "SELECT lastname, street, zip, city, pwd FROM table_name";
    $res mysql_query($sql);

    while(
    $array mysql_fetch_assoc ($res) )
    {
       foreach(
    $array AS $key => $value)
       {
          if(
    $value == '')
          {
             
    $emptyFields .= "$key, ";
          }
      }
      
    // empty fields for each record are in $emptyFields string.
      
    if($emptyString != '' )
      {
         
    send out an email.
      }

    There and Back Again :Ogre:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:08 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com