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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:50:41+00:00 2026-05-26T02:50:41+00:00

I am a beginner in web designing (php, mysql). I am creating a classified

  • 0

I am a beginner in web designing (php, mysql). I am creating a classified similar to Craigslist but not as complex.

I managed to get the user ad input as well as pics inserted into mysql databases and everything is working perfectly.

I also managed to fetch the data when a user searches a specific category like cars

    $query="SELECT city, title, price FROM md_post WHERE category='cars'";

$result= mysql_query($query) or die (mysql_error());

while($row = mysql_fetch_array($result)){
echo "<a href='XXXX.php'>". $row['title']. " - ". $row['price']." - ".$row['city']."</a>";
echo "<br /><br />";

OUTPUT IS:
Charlotte – NISSAN – $9000
Charlotte – BMW – $11000

what i want now is, when a user clicks on a title ad, the user is redirected to the ad page itself. ( just the like what Craigslist or any classified would do)

how can I do this? I know it is a general questions and i am not expecting anybody to provide a whole code but i need hints and ideas please.

I will be very grateful. 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-26T02:50:42+00:00Added an answer on May 26, 2026 at 2:50 am

    You would need the records in your database to have a unique field that is auto_incrementing (counting up automatically when a new row is inserted).

    http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html

    When you select your ads from the database, you can take the ID for that ad out of the database at the same time

    $query="SELECT ad_id, city, title, price FROM md_post WHERE category='cars'";
    

    Then get the ad_id in the same way $row['ad_id'].

    You could then post this straight in to your HTML tag to form a URL like: ad.php?id={ID OF AD HERE}

    echo "<a href='ad.php?id=' . $row['ad_id'] . '>". $row['title']. " - ". $row['price']." - ".$row['city']."</a>";
    

    Then in your ad.php you can pic this ID up using

    echo $_GET['id'];
    

    You can use this ID in a query to select the correct ad… but make sure if you’re selecting from your database to use mysql_real_escape_string($_GET['id']) to prevent SQL injection.

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

Sidebar

Related Questions

I'm not a beginner at C# but I really need to increase my understanding,
Am working on web Services... and am a beginner, Am trying to get Oracle
I'm still a beginner at web development. It's not my profession. So go easy.
I'm interested in wed development and web 2.0 but I'm a real beginner, so
I am beginner in web development, I am developing a site that allows user
I want to create my very first web app using HTML, MySQL, PHP and
I am a web application developer, just a beginner. I am designing a small
I'm not a beginner, but the more I think about this issue, the more
I'm more or less a beginner with web services but I've tried googling this
I am a total beginner in PHP and writes simple web apps in procedural

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.