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

  • Home
  • SEARCH
  • 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 9098069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:16:26+00:00 2026-06-17T00:16:26+00:00

I have created the function below; To check if a record exists in the

  • 0

I have created the function below;

To check if a record exists in the db or not, if record exists should return true, else false and currently returns the fourth column of the row which is the field $row[‘isannounced’].

The value will be true or false. But the problem is if the row is empty, the row count will still be 1. is there a better way to handle this?

Thanks in advance.

function isnotificationannounced($dspid, $clldsq, $clldtm){
//echo 'in : isnotificationannounced<br>';

$res=false;
$qry = "SELECT * FROM tbl_maindisplay_notification where (clldsq='$clldsq' AND clldtm='$clldtm' AND dspid='$dspid')";
//echo $qry;
    $result = querydb($qry);
    if ($result) {
        $row = mysql_fetch_array($result);
        //echo 'row data:<br>';print_r($row);
        if(count($row)>0){
                $res=$row[4];
                //print_r($row);
        }           
    } else {
        die("existsindb: Query failed");
    }
    unset($clldsq, $clldtm, $tdcode);
return $res;
}
  • 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-17T00:16:27+00:00Added an answer on June 17, 2026 at 12:16 am

    With select * , you’re querying the complete table contents.

    Try using select count(*) from , and check the return value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function to create a pdf which should return bitarray. Below is
i have created below function to get date difference between two dates.. pleas check
I have created a function which gets an encoded string (possibly UTF-16 not sure)
I have created a function that will return the string path from my DB.
I have created this function to check abecedarian with while loop (A word is
Hey, so I have created a function to check the DB for unique entries,
Hi I have created the code below to check if a user is valid
I have the below configuration where I'm trying to create a test C function
I have created a function that shows/hides different messages according to a combination of
I have created a function in an application that checks for username and password

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.