Zen Cart Logo
Forums / All Other Contributions/Addons / I have a trouble with this script

I have a trouble with this script

Locked

Views: 871

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
6 Jul 2007, 9:46 AM
#1
felixvalea avatar

felixvalea

New Zenner

Join Date:
Jul 2007
Posts:
2
Plugin Contributions:
0

I have a trouble with this script

I need to extract products but easy populate does not help me, cause i need to export for some sites for pub like www.price.ro . i have this script but does not work. it doues not return nothing. if i try to change the datebase user and pass it does not return an error like I cant conect to datebase... nothing. pls help me. what is wrog?

<?php set_time_limit(0); // schimbati mai jos userul , parola si numele bazei de date $prefix = "zen_"; $host = "localhost"; $user = "-------"; $passwd = "---------"; $dbName = "------------"; //------------------------------------------------------ $conn = mysql_connect("localhost", $user, $passwd); if (!$conn) { print "Nu pot sa creez conexiune la mysql";exit; } $selected_db = mysql_select_db($dbName, $conn); if (!$selected_db) { print "Nu pot sa selectez baza de date";exit; } $q = " SELECT p.products_id as cod, cd.categories_name as numecategorie, m.manufacturers_name as numemarca, pd.products_name as numeprodus, pd.products_description as descriere, p.products_price as pret, 0 as stoc, 1 as activ, CONCAT('http://www.site.com/images/', p.products_image) as poza1, CONCAT('http://www.site.com/index.php?main_page=product_info&products_id=', p.products_id) as url_produs, '' as garantie FROM ".$prefix."products p LEFT JOIN ".$prefix."manufacturers m ON (p.manufacturers_id = m.manufacturers_id) LEFT JOIN ".$prefix."categories c ON (p.master_categories_id =c.categories_id) LEFT JOIN ".$prefix."categories_description cd ON (c.categories_id=cd.categories_id) LEFT JOIN ".$prefix."products_description pd ON (p.products_id=pd.products_id) WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ORDER BY p.products_id, pd.products_name "; $cursor = mysql_query( $q, $conn ); $sep = ","; $search=array("\n","\r",'"'); $replace=array('','',''); while ($r = mysql_fetch_array ($cursor)) { $d = str_replace($search, $replace, $r[4]); $d = strip_tags($d); $cod= $r[0]; $numecategorie= str_replace($search, $replace,$r[1]); $numemarca= str_replace($search, $replace,$r[2]); $numeprodus= str_replace($search, $replace,$r[3]); $pret = $r[5]; $instoc=$r[6]; $garantie=$r[10]; $url_produs= $r[9]; $url_poza1= $r[8]; print("$cod,\"$numemarca\",\"$numeprodus\",\"$url_produs\",\"$numecategorie\",$pret,$instoc,$garantie"); print(",\"\",\"$d\",$url_poza1\n");} ?>
6 Jul 2007, 10:22 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: I have a trouble with this script

The https://www.price.ro site is not ZenCart and this mod is specifically for ZenCart...

Dot not expect it to work

7 Jul 2007, 8:14 PM
#3
felixvalea avatar

felixvalea

New Zenner

Join Date:
Jul 2007
Posts:
2
Plugin Contributions:
0

Re: I have a trouble with this script

I know that price.ro is not a zen`cart site. My site is a zen cart but i need to modify this script to work, cause i need to export my products in a file to put on the www.price.ro (is a online store comparation or something like that) and easy populate dont export my datebase how i need. you can help me? i need to make this script to work with my zen cart site. thx

7 Jul 2007, 8:26 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: I have a trouble with this script

i need to make this script to work with my zen cart site
EasyPopulate does work with Zencart and I have no clue what your other script is??