vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   help with a query , is this correct ? (https://vborg.vbsupport.ru/showthread.php?t=78559)

corsacrazy 03-22-2005 05:41 PM

help with a query , is this correct ?
 
here is the query


[sql]if ($_GET['option']=="relist") {
$relistId = $_GET['id'];
$today = date( "Y-m-d H:i:s", time() );
$closingdate = closingdate($today,$_GET['duration']);
$relistAuction = mysql_query("INSERT INTO probid_auctions
(itemname, description, picpath, quantity, auctiontype, bidstart, rp,
rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, sc, scint, pm,
category, active, payment_status, startdate, enddate, closed, keywords,
nrbids, maxbid, clicks, ownerid, hpfeat, catfeat, bolditem, hlitem, private,
currency, swapped, postage_costs, insurance, type_service, isswap, acceptdirectpayment,
directpaymentemail, addlcategory, deleted) SELECT
itemname, description, picpath, quantity, auctiontype, bidstart, rp,
rpvalue, bn, bnvalue, bi, bivalue, duration, country, zip, sc, scint, pm,
category, active, payment_status, startdate, enddate, closed, keywords,
nrbids, maxbid, clicks, ownerid, hpfeat, catfeat, bolditem, hlitem, private,
currency, swapped, postage_costs, insurance, type_service, isswap, acceptdirectpayment,
directpaymentemail, addlcategory, deleted
FROM probid_auctions b WHERE b.id='".$relistId."'") or die(mysql_error());
$newId = mysql_insert_id();[/sql]

and here is the error i get from it :(

INSERT TABLE 'probid_auctions' isn't allowed in FROM table list


any ideas ?

tnguy3n 03-22-2005 05:58 PM

there's a space in between probid_auctions and b in line
Code:

FROM probid_auctions b WHERE b.id='".$relistId."'") or die(mysql_error());
maybe that causes the error.

corsacrazy 03-22-2005 06:43 PM

afraid that didnt sort it mate :(

Xenon 03-22-2005 06:43 PM

you cannot insert into the table you are using within your select query.


All times are GMT. The time now is 04:39 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00935 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete