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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:34:44+00:00 2026-06-15T03:34:44+00:00

I am using the following script to try and count the rows in a

  • 0

I am using the following script to try and count the rows in a table, the problem I keep getting is the error :

Query was empty
Quiz Name

and a blank page. Im new to COUNT, so I think I might be making a mess of it :-S .
My database layout is as follows :

itsnb_chronoforms_data_createquestions cf_id ,cf_uid,cf_created ,cf_modified, cf_ipaddress,    cf_user_id, quizID, questionID, quizquestion, quizanswer1, quizanswer2, quizanswer3, quizanswer4,     questionformat ,correctanswer

The script I am working on is :

    // Define Quiz Variables
    $quiz = $row['quizID'];
    $quizcfid = $row['cf_id'];
    $quizname = $row['quizname'];
    // Finish Define Quiz Variables  

    ///////////////////////////////////////////////////////////////////////////////////////////////
    // Make a MySQL Connection

    $query8 = "SELECT COUNT(*) as 'numberofquestions' FROM employees WHERE quizID='$quiz'"; 

    $result8 = mysql_query($query) or die(mysql_error());

    // Print out result
    while($row8 = mysql_fetch_array($result8)){
        echo 'There are '. $row8['COUNT(quizID)'] . ' questions';
    } 
    ///////////////////////////////////////////////////////////////////////////////////////////////
  • 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-15T03:34:45+00:00Added an answer on June 15, 2026 at 3:34 am

    Your problem is that you are running the wrong query, you are running $query and not $query8

    change to this :

    $result8 = mysql_query($query8) or die(mysql_error());
    

    in a second glance, you should also change to :

    echo 'There are '. $row8['numberofquestions'] . ' questions';
    

    as you set numberofquestion to be the count alias.

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

Sidebar

Related Questions

I am using the following script to try and count the number of new
I'm attempting to create a table for monitoring purposes using the following script: $w3wppriv
I am using the following script from nettuts: // Our custom error handler function
I am using the following script <script> function getXMLHTTP() { var xmlhttp=false; try{ xmlhttp=new
I'm try to use the following script to fetch user data from a table
I've tried to change filenames using following script: find dir/ -type f -exec mv
I'm using the following script in my website in order to create pagination next-previous
I'm using the following script to request new content to a file called index.html:
I'm using the following script to force a specific page - when loaded for
I am currently using the following script to set this value as a String:

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.