Jump to content

problème avec getValue


abdelwahed

Recommended Posts

Bonsoir, j'ai un problème dans ma requête elle me retourne rien et j'ai pas compris pourquoi

<?php 
include(dirname(__FILE__) . '/config/config.inc.php');


$fic=fopen("classeur1.csv", "r"); 


while(!feof($fic)) 
{ 
$ligne= fgets($fic,1024); 


$sql = Db::getInstance()->getValue('SELECT p.id_product FROM ' . _DB_PREFIX_ . 'product_lang p WHERE p.`name` LIKE "'.$ligne.'" ');
var_dump( 'SELECT p.id_product FROM ' . _DB_PREFIX_ . 'product_lang p WHERE p.`name` LIKE "'.$ligne.'"');
echo $sql;
 if (!empty($sql))
{
   echo $sql;
   echo $ligne . "<br />"; 
    }
} 
fclose($fic) ; 

?> 
Link to comment
Share on other sites

fichier.csv : contient 

 

exemple det
Chemisier
Jamila
 
 
 
resultat de var-dump:
 
 
 
string 'SELECT p.id_product FROM ps_product_lang p WHERE p.`name` LIKE "     exemple det

" ' (length=82)
string 'SELECT p.id_product FROM ps_product_lang p WHERE p.`name` LIKE "     Chemisier

" ' (length=80)
string 'SELECT p.id_product FROM ps_product_lang p WHERE p.`name` LIKE "     Jamila " ' (length=75)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...