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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:25:54+00:00 2026-06-06T04:25:54+00:00

This is pretty straight forward. EDIT: Updated question and added fourth echo. Here is

  • 0

This is pretty straight forward.
EDIT: Updated question and added fourth echo.

Here is PHP code:

<?php

$ratings="3";
$item="Inception";

$query="SELECT * FROM items WHERE item = '". $item ."' LIMIT 1";

echo $query;

echo "<br />";

$result=mysql_query($query);

echo $result;

echo "<br />";

while ($row = mysql_fetch_array($result)) { 
    $item_id = $row['item_id'];
    echo $item_id;
    echo "<br />";
 }  

  $query_two = "INSERT INTO ratings (rating, item_id), VALUES (' {$ratings} ', ' {$item_id} ')";

  echo $query_two;
  $sql = mysql_query($query_two);
  mysql_close();
?>

Here is web output with all the echo’s:

SELECT * FROM items WHERE item = 'Inception' LIMIT 1
Resource id #7


INSERT INTO ratings (rating, item_id), VALUES (' 3 ', ' ')

How come my $item_id is blank? (third row underneath Resource id)

  • 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-06T04:25:58+00:00Added an answer on June 6, 2026 at 4:25 am

    This part of code produces it:

    $result=mysql_query($query);
    
    echo $result;
    

    It shows Resource... because it is of resource type, it’s just a sort of special handler for query, it’s not like normal type (string or int for example), so it has nothing readable to print.

    If you want to print data from query then you must firstly fetch it.

    Also note that those mysql_* functions are deprecated, it is discouraged to use them. Note from php manual:

    Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL
    extension should be used. See also MySQL: choosing an API guide and
    related FAQ for more information. Alternatives to this function
    include:

    mysqli_query()

    PDO::query()

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

Sidebar

Related Questions

this may sound pretty straight forward, but still I want to post this question
Well, first of all sorry about this question it must be pretty straight forward
This seems like it should be pretty straight forward, but I'm apparently confused. I
This should be a pretty straightforward question. I have the following code, which forms
I thought this was pretty straight forward but I don't get the same results
I figure this is a straight forward question, and I think there is a
This is a pretty straight forward attempt. I haven't been using python for too
I have a pretty straight forward nested form. Categories has_many awards has_many recommendations. So
Edit : See my full answer at the bottom of this question. tl;dr answer
Pretty straight forward I suppose. Getting the background position is easy, but just getting

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.