Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

randomn contrib. - need php help!!


gersh

Recommended Posts

Hello,

 

I found a randomnize contribution to show my products on an external site.

So my shop is in german and english language the tool shows the product names in both languages - but I want only the german ones.

I tried several hours to insert the command "language=de&" to the php lines - but it doesn't work.

Will anyone be able to help me?

 

Merci

Gershwin

 

Part of the script:

 

$db = mysql_select_db("$db_name", $connection)

or die("Couldn't select database.");

 

// create SQL statement

$sql = "SELECT * FROM `products` ORDER BY RAND() LIMIT 1";

 

// execute SQL query and get result

$sql_result = mysql_query($sql,$connection)

or die("Couldn't execute quasery.");

 

// format results by row

$row = mysql_fetch_array($sql_result);

 

$products_id = $row["products_id"];

$products_price = $row["products_price"];

$products_model = $row["products_model"];

$products_image = $row["products_image"];

 

$sql2 = "SELECT `products_name` FROM `products_description` WHERE products_id = '$products_id' LIMIT 1";

$sql2_result = mysql_query($sql2,$connection)

or die("Couldn't execute query.");

$row2 = mysql_fetch_array($sql2_result);

 

$products_name = $row2["products_name"];

$products_image_replace = str_replace("./", "/", $products_image);

$products_price_replace = str_replace(".0000", "", $products_price);

 

if ($product_info_link_show == "1") {

echo "<a href=\"http://$domain_name/$catalog_folder_name/product_info.php?products_id=$products_id\" target=_content style=\"text-decoration: none\">";

}

if ($product_image_show == "1") {

echo "<img src=\"http://$domain_name/$catalog_folder_name/images/$products_image_replace\" width=\"$image_width\" height=\"$image_height\" border=\"0\"><br>";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...