Jump to content

Make a SELECT on Prestashop


Recommended Posts

Hello Friends,

 

I am needing to do a SELECT on database Prestashop! Where must bring the following information:

 

Price, Title and Image.

 

I did so:

 

I created a select calling this information:

 

 

<? 
include("../itens/conn.php");
$lang = "1";
$lim_prod = "28";

$SQLprod = "SELECT * from ps1__product, ps1__image, ps1__image_lang WHERE (ps1__product.id_product = ps1__image.id_product) LIMIT $lim_prod ";
$prod = mysql_query($SQLprod);

?>

 

After I created a logic to display information from select.

 

 

<? while ($p = mysql_fetch_array($prod)){ 
$products_id = $p['id_product'];
  $prodnome = $p['legend'];
$pnome = substr($prodnome,0,20);
$prodtit = $p['legend'];
$ptit = substr($prodtit,0,24);
$pimg = $p['id_lang'];
$preco = $p['price'];
$preco=number_format($preco,2,'.',',');
?>
<div class="prod"><a href="http://dyingmusic.com/criandonovalojadm2/modules/homefeatured/homefeatured.php?id_product=<? echo $products_id; ?>" target="_blank"><img src="../criandonovalojadm2/img/p<? echo $pimg ?>" alt="<? echo $pnome ?>" style="width:120px;height:120px;border:none;" /></a>
               <br />
<span><? echo $pnome; ?></span>
               <br />
<span class="title"><? echo $ptit; ?></span><? if (strlen($ptit) > 21){ echo "...";}?>
               <br />
               <span class="preco">R$ <? echo $preco ?></span>
               </div>
<? } ?>

 

 

I think the error is here:

 

<a href="http://dyingmusic.com/criandonovalojadm2/modules/homefeatured/homefeatured.php?id_product=<? echo $products_id; ?>

 

 

 

See the result on this test page: http://dyingmusic.com/site/fred_test.php

 

Can anyone help me?

Thanks...

 

Fred Azevêdo!

Link to comment
Share on other sites

×
×
  • Create New...