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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:59:29+00:00 2026-06-15T11:59:29+00:00

I am trying to use the output of an SQL query (in this case

  • 0

I am trying to use the output of an SQL query (in this case the output will be something like 26 “http://www.google.com”

I want to use the id and address in a process in php but cant seem to do anything with the output of the query other than echo it.

ultimately if i could end up with $id and $pos as variables that i could use that would be great.

<?php
$con = mysql_connect("localhost","root","root");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("movieCol", $con);
$query = "SELECT * FROM `movie_collection` ORDER BY `id` DESC LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['id']. " ". $row['poster'];
mysql_close($con);
?>
  • 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-15T11:59:30+00:00Added an answer on June 15, 2026 at 11:59 am

    Just assign the values to variables as:
    $id=$row['id'];
    and
    $pos=$row['poster'];

    Now you can use the variables $id and $pos wherever you want.

    I hope this is what you wanted.

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

Sidebar

Related Questions

I am trying to write a SQL Server 2008 query which will output data
I'm trying to use PDO in this way and reuse the output template: selected_products_show
I am trying to do rather complex SQL query to produce a report. This
So basically I'm trying to replicate this query as a stored procedure. Use ThisDB
I am trying to use a XslCompiledTransform, and use the output as a XPathDocument.
I'm trying to use XSLT text output to generate a file (in a file
I am trying to use pthread mutex variables and barrier to synchronize the output
I'm trying to use XSL-stylesheets in order to transform some generated XML-data to HTML-output.
I am trying to build a database project, and then use the output along
I am trying to optimize a sql query which is using order by clause.

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.