#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    156
    Rep Power
    13

    PHP error column issue


    Hi

    I added extra fields following the link below

    http://www.webidsupp....ight=condition

    I get the following error after pressing submit

    An unexpected error occurred. The error has been forwarded to our technical team and will be fixed shortly

    I checked the error log just now in admin ->tools and has the following

    Ford Mondeo

    ', '', 198, 0, '299', '0', '0', '299', '1', '1',
    '1', '2', 'Array', 'Silver', '3', '2', '1', '0', '2', '1', 0, '1367774117', 0, 0, 1, 1, 0, 0, 0, 0, 'n', '', 'y', 'n', 'n', 'n', 0.00)
    Column count doesn't match value count at row 1
    page:/home/sites/247autotrade.com/public_html/sell.php line:108

    I found it is because I have a field short in the coding I am guessing as also found out there are more database columns than there are values, is that right? if so just unsure how to correct it

    I have been trying to fix it for ages but can't seem to do it

    Is it to do with the coding below

    PHP Code:
    return "INSERT INTO " $DBPrefix "auctions VALUES (NULL, " .$user->user_data['id'] . ", '" .  
    $system->cleanvars($_SESSION['SELL_title']) . "', '" $system->cleanvars($_SESSION['SELL_subtitle']) . "', '" $a_starts "', '" addslashes($_SESSION['SELL_description']) . "', '" $system->cleanvars($_SESSION['SELL_pict_url']) . "', " $_SESSION['SELL_sellcat1'] . ", " intval($_SESSION['SELL_sellcat2']) . ", '" $system->input_money(($_SESSION['SELL_buy_now_only'] == 'n') ? $_SESSION['SELL_minimum_bid'] : $_SESSION['SELL_buy_now_price']) . "', '" $system->input_money($_SESSION['SELL_shipping_cost']) . "', '" $system->input_money(($_SESSION['SELL_with_reserve'] == 'yes') ? $_SESSION['SELL_reserve_price'] : 0) . "', '" $system->input_money(($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" $_SESSION['SELL_atype'] . "', '" $_SESSION['SELL_condition'] . "', 
    '" 
    $_SESSION['SELL_make'] . "', '" $_SESSION['SELL_model'] . "', '" $_SESSION['SELL_number_doors'] . "', '" 
    $_SESSION['SELL_colour'] . "', '" $_SESSION['SELL_year'] . "', '" $_SESSION['SELL_fuel_type'] . "', '"  
    $_SESSION['SELL_duration'] . "', '" $system->input_money($_SESSION['SELL_customincrement']) . "', '" $_SESSION['SELL_shipping'] . "', '" $payment_text "', " . (($_SESSION['SELL_international']) ? 0) . ", '" $a_ends "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 0) . ", " $_SESSION['SELL_iquantity'] . ", 0, " intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" $_SESSION['SELL_buy_now_only'] . "', '" $_SESSION['SELL_is_bold'] . "', '" $_SESSION['SELL_is_highlighted'] . "', '" $_SESSION['SELL_is_featured'] . "', " $fee ")"

    Thank you in advance

    Kind regards

    Ian
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    would you please stop crossposting every single thread in 10 different forums without telling anybody of it? I find that very rude. Just because something is free doesn't mean you're free to abuse it.

    Also, crossposting does not necessarily yield more answers. We aren't stupid. Many people won't even bother reading your questions if they find out that you copypasta your threads all around the internet.

    As to your question: Nobody can help you without knowing the exact structure of your auctions table. Since the code doesn't do explicit assignments and instead relies on some default column order (which you just changed), this is gonna be f*cking detective work.

    As I already said in your previous thread, the underlying problem of all your PHP issues is that the code is crap in every aspect. This snippet alone proves that yet again. Unless you've already invested a lot of money and/or time in it, throw it away and look for better code. I'm sure there's a sane auction script somewhere. Maybe it won't be for free, but it'll save you a lot of money, time and headaches in the long run.

    Comments on this post

    • ptr2void agrees : Wow, that other forum thread was enlightening!
    Last edited by Jacques1; May 5th, 2013 at 06:50 AM.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo