Jump to content

Auction Re-list Help


Makaveli19

Recommended Posts

Hello,

 

I was hoping somebody could help me out. I have an auction site with a mod that allows me to create custom shipping conditions.

 

My problem is that when I re-list an auction everything gets re-listed except the custom shipping options. I have tried to fix this issue myself with no luck. I have fixed some other re-listing issues but I seem to be having difficulty with this since I am not as experienced in PHP.

 

This is the section where most of the re-listing takes place

 

$today = date( "Y-m-d H:i:s", time() );
$closingdate = closingdate($today,$_POST['duration'][$relistId]);
$relistAuction[$relist_counter] = mysql_query("INSERT INTO probid_auctions (itemname, description, picpath, quantity, auctiontype, bidstart, rp, rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, intersection, city, state, sc,scint, pm, main_category, category, active, payment_status, startdate, enddate, closed, keywords, maxbid, ownerid, hpfeat, catfeat, bolditem, hlitem, private, currency, postage_costs, insurance, type_service, isswap, isverify, subitemname, sc_insurance, sc_type_service, estimated_weight_lbs, estimated_weight_oz,  package_size_length, package_size_width, package_size_height, odd_shaped_package, handling_fee, calculated, declVal, combine_shipp, main_region, region_suburbs, template, iconit, counter_style, acceptdirectpayment, addlcategory, shipping_details, hpfeat_desc, listin, accept_payment_systems, apply_vat, auto_relist, auto_relist_bids, endtime_type, videofile_path, listing_type, offer_range_min, offer_range_max, auto_relist_nb) SELECT itemname, description, picpath, quantity, auctiontype, bidstart, rp, rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, intersection, city, state, sc,scint, pm, main_category, category, active, payment_status, startdate, enddate, closed, keywords, maxbid, ownerid, hpfeat, catfeat, bolditem, hlitem, private, currency, postage_costs, insurance, type_service, isswap, isverify, subitemname, sc_insurance, sc_type_service, estimated_weight_lbs, estimated_weight_oz,  package_size_length, package_size_width, package_size_height, odd_shaped_package, handling_fee, calculated, declVal, combine_shipp, main_region, region_suburbs, template, iconit, counter_style, acceptdirectpayment, addlcategory, shipping_details, hpfeat_desc, listin, accept_payment_systems, apply_vat, auto_relist, auto_relist_bids, endtime_type, videofile_path, listing_type, offer_range_min, offer_range_max, auto_relist_nb FROM probid_auctions b WHERE b.id='".$relistId."'") or die(mysql_error()); 
$newId = mysql_insert_id();
$getfield_q[$relist_counter] = mysql_query("SELECT * from D3MO_auction_conditions WHERE auction_id='".$relistId."'");
while ($relistfield = mysql_fetch_array($getfield_q[$relist_counter])) {
$relistfield_q[$relist_counter] = mysql_query("INSERT INTO probid_auctions (values) VALUES 
('".$newId."','".$relistfield['values']."')") or die(mysql_error());			
}
$getCustomFields[$relist_counter] = mysql_query("SELECT * FROM probid_fields_data WHERE auctionid='".$relistId."'");
while ($relistFld = mysql_fetch_array($getCustomFields[$relist_counter])) {
$relistCustomFields[$relist_counter][$custom_fld++] = mysql_query("INSERT INTO probid_fields_data (auctionid,ownerid,boxid,boxvalue,active) VALUES 
('".$newId."','".$relistFld['ownerid']."','".$relistFld['boxid']."','".$relistFld['boxvalue']."','".$relistFld['active']."')") or die(mysql_error());			
}
$getImages[$relist_counter] = mysql_query("SELECT * FROM probid_auction_images WHERE auctionid='".$relistId."'") or die(mysql_error());
$addCnt=0;
while ($relistAddImages=mysql_fetch_array($getImages[$relist_counter])) {
$fileExtension = getFileExtension($relistAddImages['name']);
$addImageName = "a".$newId."_addpic".$addCnt.".".$fileExtension;				
$isUpload = uploadFile($relistAddImages['name'],$addImageName,"uplimg/");
if ($isUpload) {
$addImage[$addCnt][$relist_counter] = mysql_query("INSERT INTO probid_auction_images (name, auctionid) VALUES ('uplimg/".$addImageName."','".$newId."')") or die(mysql_error());
$addCnt++;
}}
$mainPicRelist = getSqlField("SELECT picpath FROM probid_auctions WHERE id='".$newId."'","picpath");
if ($mainPicRelist != "") {
$fileExtension = getFileExtension($mainPicRelist);
$mainPicName = "cma".$newId."_mainpic.".$fileExtension;
$isUpload = uploadFile($mainPicRelist,$mainPicName,"uplimg/");
if ($isUpload) {
$updateAuctionPic[$relist_counter] = mysql_query("UPDATE probid_auctions SET picpath='uplimg/".$mainPicName."' WHERE id='".$newId."'") or die(mysql_error());
}}

 

and heres the section where the custom shipping options get called from the auction page

 

<?

$field_q=mysql_query("SELECT * from D3MO_auction_conditions WHERE auction_id='".$auctionDetails['id']."'"); 

?> <table cellpadding="0" cellspacing="0">

<? while($field=mysql_fetch_array($field_q))

{

echo "<tr><td><li>".$field["values"]."</li></td></tr>";

}?>

</table>

 

I have been trying to figure out how to get the custom shipping info pulled from the database and entered in the new re-listed auction once the re-listing option is triggered. As it stands now, all the auction information gets re-listed except the shipping conditions which remain blank.

 

As I mentioned I have tried to fix this issue myself but I keep getting database errors. Can somebody help?

 

Thanks in advance.

Link to comment
Share on other sites

Hi Darkfreaks,

 

Well what I did was I added this line of code;

 

$getfield_q[$relist_counter] = mysql_query("SELECT * from D3MO_auction_conditions WHERE auction_id='".$relistId."'");
while ($relistfield = mysql_fetch_array($getfield_q[$relist_counter])) {
$relistfield_q[$relist_counter] = mysql_query("INSERT INTO probid_auctions (values) VALUES 
('".$newId."','".$relistfield['values']."')") or die(mysql_error());			
}

 

I added this above $getCustomFields[$relist_counter] = mysql_query("SELECT * FROM probid_fields_data WHERE auctionid='".$relistId."'"); and below $newId = mysql_insert_id(); from the relisting section I referenced in my first post.

 

I'm not sure if the code I added is even the right way about doing it, but what I basically did was mimic the "$getCustomFields" section in an attempt to get the shipping conditions listed.

 

When I do that the error is get is this;

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values) VALUES ('147','Local Shipping')' at line 1

 

In this error it mentions "Local Shipping" which is the shipping condition that I was trying to relist for this particular auction but the error prevents the re-list. I should mention the code I added was just a guess. I'm not that experienced with PHP, i just figured that the relisting commands for the custom fields and the custom shipping should be similar.

 

Any help would be greatly appreciated.

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.