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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:17:57+00:00 2026-06-12T21:17:57+00:00

I have one page whose last word is a field in my MySQL table.

  • 0

I have one page whose last word is a field in my MySQL table.

Its like that:

 www.xyz.com/etc/demo
 www.xyz.com/etc/dddred
 www.xyz.com/etc/dffgfffre

The word demo has a record in MySQL, so do the other words. So for each example a different record will be chosen. I want to pass this word into a SQL query. I have created one page www.xyz.com/etc/abc.php that executes the query, but I dont know how to get and put the value of city into the WHERE clause.

  $res = myl_query("SELECT * FROM tableA WHERE city=''");
  • 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-12T21:17:58+00:00Added an answer on June 12, 2026 at 9:17 pm

    use can use this

    $c=explode("/",$_SERVER[ 'REQUEST_URI' ]);
    
    $city=end($c);
    

    than use

    $res = mysql_query("SELECT * FROM tableA WHERE city='{$city}'");
    

    mysql_* functions are deprecated so use PDO or mysqli

    $res=$pdo->preapre("SELECT * FROM tableA WHERE city=:city");
    $res->execute(array(":city"=>$city));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I have one wordpress blog whose home page is showing a list of 10
In my project I have one table with 24*6*300 cells on one page (it's
i am porting over a website from asp. i have one page that i
I have one table having 10 rows.Now on page load lets say first 7
I have some one page whose div elements are aligned by JavaScript. The JavaScript
I have a web page whose content I'd like to download into a wxString.
I am working on an application, where I have one page whose partial content
I have one Page which is displaying details of some Client. I am using
I have one page with a Silverlight object on it, and many times when

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.