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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:38:04+00:00 2026-06-16T01:38:04+00:00

I am trying to make a comment section on my hand made site, using

  • 0

I am trying to make a comment section on my hand made site, using PHP and MySQL. I have got the comments stored in my database, but when I try to SELECT them my site throws up this error,

mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 9 in /home/a9210109/public_html/comments.php on line 16

My code so far is below

    <?php
    $comment = $_POST['comment'];
    $mysql_host = "";
    $mysql_database = "";
    $mysql_user = "";
    $mysql_password = "";
    mysql_connect($mysql_host,$mysql_user,$mysql_password);
    @mysql_select_db($mysql_database) or die( "Unable to select database");
    $CreateTable = "CREATE TABLE comments (comment VARCHAR(255), time VARCHAR(255));";
    mysql_query($CreateTable);
    $UseComment = "INSERT INTO comments VALUES ('$comment')";
    mysql_query($UseComment);
    $SelectComments = "SELECT * FROM comments";
    $comments = mysql_query($SelectComments);
    $num=mysql_numrows($comments);
    $variable=mysql_result($comments,$i,"comment");
    mysql_close();
    ?>
    <a href="#" onclick="toggle_visibility('hidden');">Show/Hide Comments</a>
    <?php
    $i=0;
    while ($i < $num) {
    $comment=mysql_result($comments,$i,"comment");
    echo "<div id='hidden' style='display:none'><h3>$comment</h3></div>";
    $i++;
    }
    ?>
  • 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-16T01:38:06+00:00Added an answer on June 16, 2026 at 1:38 am

    change

     $num=mysql_numrows($comments);
    

    to

    $num=mysql_num_rows($comments);
    

    the right syntax is mysql_num_rows not mysql_numrows

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

Sidebar

Related Questions

I'm trying to make a comment section for my site. After a comment has
I have been trying to make an asteroids clone using openGL and have gotten
when trying to make this question, i got this one it is using Java,
I have made up a simple set of web services (trying to make a
Well I have a site where I am trying to make a form comming
I'm trying to make a comments-system on my site. I manage the ajax part
I'm trying to make a very basic comment system in PHP. The problem is
I am trying to make some text scroll vertically using jQuery, I have been
Trying to make the infamous checkall checkbox for dynamically created rows from a MySQL
I am trying to make a simple game in C#/XAML. I have a worker

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.