Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Plugin Contributions
    0

    Default I have a trouble with this script

    I need to extract product`s but easy populate does not help me, cause i need to export for some site`s 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\",$p ret,$instoc,$garantie");
    print(",\"\",\"$d\",$url_poza1\n");}
    ?>

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: I have a trouble with this script

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

    Dot not expect it to work
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2007
    Posts
    2
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default 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??
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. Having trouble duplicating a script error.
    By atl2rva in forum General Questions
    Replies: 3
    Last Post: 2 Feb 2012, 05:58 PM
  2. having trouble added this script
    By Mrchristoh in forum General Questions
    Replies: 4
    Last Post: 14 May 2009, 04:05 PM
  3. I have an issue with a custom script
    By CoolCarPartsOnline in forum General Questions
    Replies: 0
    Last Post: 23 Mar 2009, 03:28 PM
  4. Please Help me with this redirection php script
    By nguyenkhv in forum General Questions
    Replies: 0
    Last Post: 29 Feb 2008, 08:40 AM
  5. Trouble with sending the gift certificate- have to be 1 cent less amt to work??
    By catangirl in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 6
    Last Post: 22 Nov 2007, 06:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR