Results 1 to 4 of 4
  1. #1
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    SQL Syntax - need some fresh eyes
    I've been looking over this for an hour, I'm missing something apparently. It's in the code because I've tried different feeds. I've tried it this way, all one one line, and every which way. It's setup (line wise) like all my other feed scripts.

    I've looked at every apostrophe and comma 1000 times. The error tells me it's failing around here:

    Code:
       CONDITION,
       WARRANTY,
       STANDARDSHIPPINGCOST) 
       values
       ('$PROGRAMNAME',
       '$PROGRAMURL',


    PHP Code:
    while($data fgetcsv($feed50000"|")){ 

    if(
    $rowNum 0) {

       
    $PROGRAMNAME addslashes($data[0]); 
       
    $PROGRAMURL addslashes($data[1]); 
       
    $CATALOGNAME addslashes($data[2]); 
       
    $LASTUPDATED addslashes($data[3]); 
       
    $NAME addslashes($data[4]); 
       
    $KEYWORDS addslashes($data[5]); 
       
    $DESCRIPTION addslashes($data[6]); 
       
    $SKU addslashes($data[7]); 
       
    $MANUFACTURER addslashes($data[8]); 
       
    $MANUFACTURERID addslashes($data[9]); 
       
    $UPC addslashes($data[10]); 
       
    $ISBN addslashes($data[11]); 
       
    $CURRENCY addslashes($data[12]); 
       
    $SALEPRICE addslashes($data[13]); 
       
    $PRICE addslashes($data[14]); 
       
    $RETAILPRICE addslashes($data[15]); 
       
    $FROMPRICE addslashes($data[16]); 
       
    $BUYURL addslashes($data[17]); 
       
    $IMPRESSIONURL addslashes($data[18]); 
       
    $IMAGEURL addslashes($data[19]); 
       
    $ADVERTISERCATEGORY addslashes($data[20]); 
       
    $THIRDPARTYID addslashes($data[21]); 
       
    $THIRDPARTYCATEGORY addslashes($data[22]); 
       
    $AUTHOR addslashes($data[23]); 
       
    $ARTIST addslashes($data[24]); 
       
    $TITLE addslashes($data[25]); 
       
    $PUBLISHER addslashes($data[26]); 
       
    $LABEL addslashes($data[27]); 
       
    $FORMAT addslashes($data[28]); 
       
    $SPECIAL addslashes($data[29]); 
       
    $GIFT addslashes($data[30]); 
       
    $PROMOTIONALTEXT addslashes($data[31]); 
       
    $STARTDATE addslashes($data[32]); 
       
    $ENDDATE addslashes($data[33]); 
       
    $OFFLINE addslashes($data[34]); 
       
    $ONLINE addslashes($data[35]); 
       
    $INSTOCK addslashes($data[36]); 
       
    $CONDITION addslashes($data[37]); 
       
    $WARRANTY addslashes($data[38]); 
       
    $STANDARDSHIPPINGCOST addslashes($data[39]); 

       
    $sql mysql_query("insert into $temptable 
       (PROGRAMNAME,
       PROGRAMURL,
       CATALOGNAME,
       LASTUPDATED,
       NAME,
       KEYWORDS,
       DESCRIPTION,
       SKU,
       MANUFACTURER,
       MANUFACTURERID,
       UPC,
       ISBN,
       CURRENCY,
       SALEPRICE,
       PRICE,
       RETAILPRICE,
       FROMPRICE,
       BUYURL,
       IMPRESSIONURL,
       IMAGEURL,
       ADVERTISERCATEGORY,
       THIRDPARTYID,
       THIRDPARTYCATEGORY,
       AUTHOR,
       ARTIST,
       TITLE,
       PUBLISHER,
       LABEL,
       FORMAT,
       SPECIAL,
       GIFT,
       PROMOTIONALTEXT,
       STARTDATE,
       ENDDATE,
       OFFLINE,
       ONLINE,
       INSTOCK,
       CONDITION,
       WARRANTY,
       STANDARDSHIPPINGCOST) 
       values
       ('
    $PROGRAMNAME',
       '
    $PROGRAMURL',
       '
    $CATALOGNAME',
       '
    $LASTUPDATED',
       '
    $NAME',
       '
    $KEYWORDS',
       '
    $DESCRIPTION',
       '
    $SKU',
       '
    $MANUFACTURER',
       '
    $MANUFACTURERID',
       '
    $UPC',
       '
    $ISBN',
       '
    $CURRENCY',
       '
    $SALEPRICE',
       '
    $PRICE',
       '
    $RETAILPRICE',
       '
    $FROMPRICE',
       '
    $BUYURL',
       '
    $IMPRESSIONURL',
       '
    $IMAGEURL',
       '
    $ADVERTISERCATEGORY',
       '
    $THIRDPARTYID',
       '
    $THIRDPARTYCATEGORY',
       '
    $AUTHOR',
       '
    $ARTIST',
       '
    $TITLE',
       '
    $PUBLISHER',
       '
    $LABEL',
       '
    $FORMAT',
       '
    $SPECIAL',
       '
    $GIFT',
       '
    $PROMOTIONALTEXT',
       '
    $STARTDATE',
       '
    $ENDDATE',
       '
    $OFFLINE',
       '
    $ONLINE',
       '
    $INSTOCK',
       '
    $CONDITION',
       '
    $WARRANTY',
       '
    $STANDARDSHIPPINGCOST')
    "
    ) or die(mysql_error());
    }
       
    $rowNum++; 


    Shawn Kerr (.com) | Disney World | SEC Football

  2. #2
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Nevermind.

    Shawn Kerr (.com) | Disney World | SEC Football

  3. #3
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Location
    Mansfield, TX
    Posts
    16,232
    CONDITION is a SQL reserved word.

    Mimer SQL Developers - SQL Reserved Words Overview

    Try `CONDITION`.
    Michael Coley
    Amazing-Bargains.com
     Affiliate Tips | Merchant Best Practices | Affiliate Friendly? | Couponing | CPA Networks? | ABW Tips | Activating Affiliates
    "Education is the most powerful weapon which you can use to change the world." Nelson Mandela

  4. #4
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Yeah. I had tried backticks earlier (when ruling out possibilities). It still spit out the error (I did it to every single one). Why it worked the next time I did it I don't know.

    My first venture into CJ feeds (since Newegg's affiliate managers and external feeds both became zeros, lol).

    Shawn Kerr (.com) | Disney World | SEC Football

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. OneNetworkDirect - SubID tracking Syntax
    By treehugger in forum Other Affiliate Networks
    Replies: 2
    Last Post: February 19th, 2009, 10:13 AM
  2. PHP/MySQL syntax question?
    By AcuraImport in forum Programming / Datafeeds / Tools
    Replies: 8
    Last Post: April 18th, 2004, 06:25 PM
  3. Syntax for If - then
    By aprillougheed in forum WebMerge (Fourthworld.com)
    Replies: 2
    Last Post: March 14th, 2004, 06:55 PM
  4. redirect syntax
    By John Kruger in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: December 12th, 2002, 11:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •