Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7919103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:44:51+00:00 2026-06-03T15:44:51+00:00

i have a table like this +—————————————————————–+ | seeker | +—-+——-+———-+—————+————————-+ | id |

  • 0

i have a table like this

+-----------------------------------------------------------------+
|                              seeker                             |
+----+-------+----------+---------------+-------------------------+
| id | name  | password | register_date | login_date | limit_date |
+----+-------+----------+---------------+------------+------------+
| 01 | ali   |   ****   |  2012-02-08   | 2012-02-09 | 2012-03-09 |
| 02 | hamza |   ****   |  2012-04-10   | 0000-00-00 | 0000-00-00 |
| 03 | sam   |   ****   |  2012-04-15   | 0000-00-00 | 0000-00-00 |
+----+-------+----------+---------------+------------+------------+

register_date = when user ger registered
login-date= when user attempt to login
limit date= login-date + 1 month

now i have to apply two different delete query
one for user who register and login “ali”
one for user who only register but didnot attempt to login “hamza, sam” and have login-date=’0000-00-00′

i am using if-statment like this

 $qry="select * from seeker where login_date='0000-00-00'";
    $rs= mysql_query($qry, $con);
    $res=mysql_fetch_array($rs);

    if($res==0)
    {
      //query to delete user who has login date
      $q= "delete from seeker where current_date = limit_date'";
      if($rq=mysql_query($q, $con));
      echo "$q";

    }

   else if($res!=0)
    {
        //query to delete user who didnot login and has login-date='0000-00-00'
        $qry1="delete from seeker where '$days' >= 30";
            $rs1= mysql_query($qry1, $con);
            echo $qry1;
    }

i am very confused and making some mistake in if-statment i guess.
when i run this code it executes only else if . it should also execute first if because both conditions occurs according to my database

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:44:53+00:00Added an answer on June 3, 2026 at 3:44 pm

    i guess u wanted to retrieve the number of rows so :

     $qry="select * from seeker where login_date='0000-00-00'";
        $rs= mysql_query($qry, $con);
        $res=mysql_num_rows($rs);
    
        if($res==0)
        {
          //query to delete user who has login date
          $q= "delete from seeker where current_date = limit_date'";
          if($rq=mysql_query($q, $con));
          echo "$q";
    
        }
    
       else if($res!=0)
        {
            //query to delete user who didnot login and has login-date='0000-00-00'
            $qry1="delete from seeker where '$days' >= 30";
                $rs1= mysql_query($qry1, $con);
                echo $qry1;
        }
    

    EDIT :

    <?php
    
        $qry="select * from seeker where login_date='0000-00-00'";
        $rs= mysql_query($qry, $con);
        $res=mysql_num_rows($rs);
    
    
        if($res!=0)
        {
            $qry1="delete from seeker where '$days' >= 30";
                $rs1= mysql_query($qry1, $con);
                echo $qry1;
        }
    
        $qry="select * from seeker where current_date = limit_date";
        $rs= mysql_query($qry, $con);
        $res=mysql_num_rows($rs);
    
        if($res!=0)
        {
             $q= "delete from seeker where current_date = limit_date";
                $rs1= mysql_query($qry1, $con);
                echo $qry1;
        }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this: name code group john 12 smith 15 how
i have a table like this one: -------------------------------- id | name -------------------------------- 1 |
I have two table like this table_CN (_id, name, phone, favorite, title) table_EN (_id,
I have a table like this table name: products +----+-------------+-----------+ | id | name
I have table like this ------------------------------------------------------------------- id | title | image | name |
I have a table like this: ID | name ================================= 1 | apple 1
I have a table like this: |sub_account|name|email| |-----------|----|-----| // same account and same name:
I have a table like this.. S.No Name created_date 1 N1 2011-01-08 2 N2
I have a table like this: id | name | class | marks 1
I have a table like this id, name, datetime which might store multiple entries

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.