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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:37:30+00:00 2026-06-01T10:37:30+00:00

I am getting the Resource id #3 error when I am trying to echo

  • 0

I am getting the Resource id #3 error when I am trying to echo out the value of the column counter from the database. I want to get a single value only. Any ideas how can I do that ?

$Page = $_SERVER['PHP_SELF'];
$num = preg_replace("/[^0-9]/", '', $Page);


$query = "SELECT * FROM hitscounter WHERE page='$num';";
$res = mysql_query($query);
if (mysql_num_rows($res) > 0) {

mysql_query("UPDATE hitscounter SET counter=counter+1 Where page='$num'");
$views = mysql_query("SELECT counter FROM hitscounter WHERE page=555");
    mysql_fetch_array($views, MYSQL_NUM);
    mysql_free_result($views);
    echo $views;
}
  • 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-01T10:37:31+00:00Added an answer on June 1, 2026 at 10:37 am

    you should use the result you get back from mysql_fetch_array, just like this:

    $result = mysql_fetch_array($views, MYSQL_NUM);
    print_r($result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to access a resource file from a servlet but getting HTTP
Since upgrading from WAS6.1 to WAS7.0 I'm getting an error when trying to display
I'm trying to use a global resource dictionary, but I'm getting an error when
I am getting an error when trying to use the resource route helper functions
I am getting the following error message when trying to execute a GET REST
I am trying to grab a webpage with actionscript, but keep getting this error
since I'm using custom skin classes in Flex I'm getting an error, when trying
I'm getting the error *Warning: fwrite(): supplied argument is not a valid stream resource
I am trying to use a nested form but keep getting this error when
I'm trying to select from my MySQL database, from the table Lines. I made

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.