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 8265427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:47:58+00:00 2026-06-08T04:47:58+00:00

I have a published field that has either a value of 1 or 0.

  • 0

I have a published field that has either a value of 1 or 0. I want to be able to alert the user to how many records require publishing, or are unpublished. I want to count the number of records from table testimonials where published is equal to 0 and output that value as

Awaiting to be published:#with published=0

I have this and I realize it is wrong:

$sql = mysql_query("SELECT * FROM testimonials WHERE published='0'");
$result=mysql_num_rows($sql);
echo $result;
  • 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-08T04:48:01+00:00Added an answer on June 8, 2026 at 4:48 am
    $sql = mysql_query("SELECT SUM(published=0) AS nb_unpublished,
                               SUM(published=1) AS nb_published FROM testimonials");
    $result = mysql_fetch_assoc($sql);
    echo "Records awaiting to be published:" . $result['nb_unpublished'] . '<br>';
    echo "Records already published:" . $result['nb_published'] . '<br>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have published my project and exe file has been created.... now i want
I have a java application that has Web Services published using Axis. With the
Specifically, I have a model that has a field like this pub_date = models.DateField(date
I read everywhere that rewriting history of commits that have been published is bad
I have Post model with published? field and some authorization system which defines admin?
I have a model which has a field status definde as: class Model(models.Model): ...
I have a model, blog_posts which has a field published_at. I'd like to select
I have an event object which has from_date as a field which represents when
Is it possible to have a Rules Condition that a node has been updated
We have a metadata schema that has 3 fields in it - 2 text

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.