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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:53:10+00:00 2026-06-01T11:53:10+00:00

I am fetching all records from a db table into a page using; SELECT

  • 0

I am fetching all records from a db table into a page using;

SELECT * FROM table_name;

The page displays a summary of car details:

car-list

Now the idea is to create another page that will load the full content of each car. The issue is that I have no idea how to do it. I have searched on the internet but i dont get any results and i am new to php.

MYSQL query would be something like;

SELECT * FROM table_name WHERE id = {$clicked-id}

where clicked id is the previous clicked car. i guess i have to assign an id to each previous car title.

I am quite lost, can someone please help me.

  • 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-01T11:53:12+00:00Added an answer on June 1, 2026 at 11:53 am

    Read the PHP manual, it’s very helpful.

    Basically the link should be something like:

    <a href="/detail.php?id=<?= $car_id ?>"> car info .. </a>
    

    So you pass the clicked id in the id parameter.

    Then, in your detail page, you retrieve it like this:

    <?php
      $car_id = $_GET['id'];
      $query = 'SELECT * FROM cars WHERE id = '.intval($car_id);
    ?>
    

    I’m using $_GET here because the parameter came in the URL. Again, check out the PHP manual, it’s very helpful with this early stuff.

    Note that I used intval to keep SQL injection off my back. You should research about it if you don’t know what it means. The basic idea here is to prevent a user from calling something like detail.php?id=1;DROP TABLE cars;, which, if not using intval, would make your query:

    SELECT * FROM cars WHERE id = 1;DROP TABLE cars;
    

    Which would destroy your data.

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

Sidebar

Related Questions

I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text
I am fetching records from one table with count of one field with other
I am fetching some content from another page using jQuery .get() like this -
I'm fetching data from all 3 tables at once to avoid network latency. Fetching
I am fetching the current date & time using NOW() in mysql. I want
Our application has a table which stores all transactions records of clients in one
I am fetching all stations which belong to a station group from my database.
Essentially, I have a query that is responsible for fetching all records (with specific
In my project I am fetching cities using country selected. Now I have about
I have an problem in fetching records from database with php. I have 31700

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.