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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:31:30+00:00 2026-06-13T04:31:30+00:00

I am trying to retrieve values from the database using mysql and PHP. The

  • 0

I am trying to retrieve values from the database using mysql and PHP.
The problem is :
+++ My table field (product_model_name) consist of (;) e.g Crystal;Uni and i want to filter results according to this product range.

I have tried to use mysql_real_escape_string() to deal with it but couldn’t succeed.Here is my code:

$range="Crystal;Uni"; 
$test=mysql_real_escape_string($range); 
$sql="select product_model_image from product_models where product_model_name=".$test;
$res= mysql_query($sql) or die (mysql_error());
  while($row = mysql_fetch_array($res))
 { 
 echo $row['product_model_image '];
 }

Can anybody point me where i am making mistake??

  • 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-13T04:31:32+00:00Added an answer on June 13, 2026 at 4:31 am

    try

     $sql="select product_model_image from product_models where product_model_name= '{$test}'";
    

    also use the pdo or mysqli instead mysql_*

    Here is good PDO tutorial

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

Sidebar

Related Questions

I'm trying to retrieve records from the mySQL-database but nothing gets selected. I'm using
I'm trying to retrieve values using VB.NET from a SQL database. How do I
I am trying to retrieve data from mysql database using PDO but DATABASE NOT
I am trying to retrieve the data from mysql database using PDO but I
Hi I am trying to retrieve values from database. I have a row which
I am trying to fetch data from database using php and send it to
I am trying to retrieve a blob from a postgres database using the jdbc
I have a serious problem. Firstly, I am trying to retrieve values from my
I am trying to retrieve some rows from the database using simple SELECT statement
I am trying to retrieve some data from a database using jQuery's $.getJSON method

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.