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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:44:19+00:00 2026-06-05T18:44:19+00:00

I am a newbie, a real newbie when it’s up to php… I am

  • 0

I am a newbie, a real newbie when it’s up to php…

I am building a form which gets information from the database and outputs the information for that specific selection, i have this code here:

$SQL ="SELECT hostess_id FROM hostess WHERE first_name_en="'.addslashes($_GET["titles"]).'""; 
?>

But it gives me an error, i mean it’s not correct.
How am i supposed to echo the results of this query?

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-06-05T18:44:21+00:00Added an answer on June 5, 2026 at 6:44 pm

    instead of :

    "'.addslashes($_GET["titles"]).'"
    

    do:

    '".addslashes($_GET["titles"])."'
    

    result:

    $SQL ="SELECT hostess_id FROM hostess WHERE first_name_en='".addslashes($_GET["titles"])."'"; 
    
    $query = mysql_query($SQL) or die(mysql_error());
    while($res = mysql_fetch_assoc($query)){
       echo $res["hostess_id"];
    }
    

    NB :

    stop writing new code with the ancient mysql_* functions. They are no longer maintained and community has begun the deprecation process . Instead you should learn about prepared statements and use either PDO or MySQLi. If you cannot decide, this article will help to choose. If you care to learn, here is a quite good PDO-related tutorial

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

Sidebar

Related Questions

This is a real newbie question. I have simple app that selects a picture
I'm a real newbie with php and MySQL. Now I'm working on the following
I'm a real newbie when it comes to PHP debugging so forgive my stupidity.
I know this is a real newbie question, but that's what I am! I've
I'm taking a class in PHP and I'm a real newbie when it comes
I am complete newbie for programming and this is my first real program I
Newbie question. I want to do something like: SELECT c1,c2,c3 FROM TABLE t1 UNION
Newbie asking for help: I have an array of numbers that needs to be
ok im a newbie on sessions lets imagine that we have a little login
So we have a real-estate-related site that has controller/action pairs like homes/view, realtors/edit, and

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.