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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:09:48+00:00 2026-05-22T22:09:48+00:00

Please could someone help im building my first website that pulls info from a

  • 0

Please could someone help im building my first website that pulls info from a MySQL table, so far ive successfully managed to connect to the database and pull the information i need.

my website is set up to display a single record from the table, which it is doing however i need some way of changing the URL for each record, so i can link pages to specific records. i have seen on websites like facebook everyones profile ends with a unique number. e.g. http://www.facebook.com/profile.php?id=793636552

Id like to base my ID on the primary key on my table e.g. location_id

ive included my php code so far,

<?php
require "connect.php";
$query =  "select * from location limit 1";
$result = @mysql_query($query, $connection) 
or die ("Unable to perform query<br>$query");
?>

<?php
while($row= mysql_fetch_array($result))
{
?>

<?php echo $row['image'] ?>

<?php
}
?>

Thanks

  • 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-05-22T22:09:49+00:00Added an answer on May 22, 2026 at 10:09 pm

    Use $_GET to retrieve things from the script’s query (aka command line, in a way):

    <?php
    
    $id = (intval)$_GET['id'];  // force this query parameter to be treated as an integer
    
    $query = "SELECT * FROM location WHERE id={$id};";
    $result = mysql_query($query) or die(mysql_error());
    
    if (mysql_num_rows($result) == 0) {
       echo 'nothing found';
    } else {
       $row = mysql_fetch_assoc($result);
       echo $row['image'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently written this with help from SO. Now could someone please tell me
Could someone please help me understand that why am I getting this error at
Please could someone help diagnose this tiny problem that shouldn't be one - trying
Could someone please help me with any good tools that I can use to
Ive decided that I really dont like microsoft and their ways. Please could you
Please could someone help me, i will be forever appreciative. I'm trying to create
please could someone help me with this. I can't seems to get my mind
Could someone please help me out with this. I need to find the gml:pos
Please could someone help with the following: Using PHP I want to be able
Could someone please help me to understand how to get all parameters passed to

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.