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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:44:04+00:00 2026-05-29T11:44:04+00:00

In the database I have a string like this: Caisse primaire d’assurance maladie Now

  • 0

In the database I have a string like this: Caisse primaire d'assurance maladie

Now when I try to look for it in my PHP script, it returns no items.

$array=array("Caisse primaire d'assurance maladie","Mairies","Hotels");
$in_list = "'".implode("','",$array)."'";

$stmt = $this->db->prepare('SELECT libelle,activite,adresse,tel,lat,lng FROM etablissements where type IN ('.$in_list.')');
$stmt->execute();
$stmt->bind_result($libelle,$activite,$adresse,$tel,$lat,$lng);//the $stmt is empty

Now, if i try to look for Mairies only or Hotels only it would return me a result. That mean that the apostrophe is preventing my prepared query from running correctly. How can I fix this?

  • 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-29T11:44:06+00:00Added an answer on May 29, 2026 at 11:44 am

    How can i fix this.

    By using a real prepared query, not just mocking it.

    Or by escaping your strings.

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

Sidebar

Related Questions

I have database code like this try { string strConnectionString = ConfigurationManager.ConnectionStrings[SqlServerCstr].ConnectionString; SqlConnection myConnection
I have a string like this in my MS Access database abcdefg\1234567890 I need
I have a PHP String like this: $string = 'a => 1 , b
I have a database table like this: ## Settings ## ID (string) Value (string)
I have a string in my database that represents an image. It looks like
Hi I have a JSON string that looks like this (Usingt Rails and a
I have a spinner set up like this: ArrayAdapter<String> states = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item,
I have an string in database : 3,8,10,15 and in script i have an
I have a string that looks like this, IT, MEDIA, ADVERTISING I am then
For reasons I'd rather not get into right now, I have a string like

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.