Ich habe folgendes Problem. Wollte mir privat einen Webshop bauen und irgendwie müssen die Daten aus der Testtabelle in die neue Tabelle mit viel mehr Feldern....
Ich schreibe ein INSERT für 43 Spalten. Und bei der letzten Angabe sagt PHP immer was von
unexpected T_CONSTANT_ENCAPSED_STRING
und das gleiche bei allen sprintf Befehlen
und das gleiche bei dem einfügen von Variablen z.B. $row['pic']
Was ist falsch daran?
$sql = "INSERT INTO abart.products (
products_ean ,
products_quantity ,
products_shippingtime ,
products_model ,
group_permission_0 ,
group_permission_1 ,
group_permission_2 ,
group_permission_3 ,
products_sort ,
products_image ,
products_price ,
products_discount_allowed ,
products_date_added ,
products_last_modified ,
products_date_available ,
products_weight ,
products_status ,
products_tax_class_id ,
product_template ,
options_template ,
manufacturers_id ,
products_ordered ,
products_fsk18 ,
products_vpe,
products_vpe_status ,
products_vpe_value ,
products_startpage ,
products_startpage_sort ,
group_ids ,
nc_ultra_shipping_costs ,
gm_show_date_added ,
gm_show_price_offer ,
gm_show_weight ,
gm_price_status ,
gm_min_order ,
gm_graduated_qty ,
gm_options_template ,
gm_priority ,
gm_changefreq ,
gm_show_qty_info ,
gm_sitemap_entry ,
products_image_w ,
products_image_h
)
VALUES (
'', '' , '' ,
".$row['anr']." , 0 , 0 , 0 , 0 , 0 ,
".$row['pic']." , ".$row['pre_a']." , 0 ,
".$row[DATUM].", "" , NULL , 1 , 1 , 1 ,
".$row['offen']." ,
".$row['offen']." , 0 ,
". sprintf("%01.4f", 0)." ,
0 , 0, 0 , sprintf("%01.4f", 0) ,
0 , 0 ,NULL ,NULL, 0 , NULL,
NULL , NULL ,". sprintf("%01.4f", 1)." ,
".sprintf("%01.4f", 1)." ,
NULL ,"0.5" ,"daily" ,NULL ,
"1" , 100 , 100
)";
Ich schreibe ein INSERT für 43 Spalten. Und bei der letzten Angabe sagt PHP immer was von
unexpected T_CONSTANT_ENCAPSED_STRING
und das gleiche bei allen sprintf Befehlen
und das gleiche bei dem einfügen von Variablen z.B. $row['pic']
Was ist falsch daran?
$sql = "INSERT INTO abart.products (
products_ean ,
products_quantity ,
products_shippingtime ,
products_model ,
group_permission_0 ,
group_permission_1 ,
group_permission_2 ,
group_permission_3 ,
products_sort ,
products_image ,
products_price ,
products_discount_allowed ,
products_date_added ,
products_last_modified ,
products_date_available ,
products_weight ,
products_status ,
products_tax_class_id ,
product_template ,
options_template ,
manufacturers_id ,
products_ordered ,
products_fsk18 ,
products_vpe,
products_vpe_status ,
products_vpe_value ,
products_startpage ,
products_startpage_sort ,
group_ids ,
nc_ultra_shipping_costs ,
gm_show_date_added ,
gm_show_price_offer ,
gm_show_weight ,
gm_price_status ,
gm_min_order ,
gm_graduated_qty ,
gm_options_template ,
gm_priority ,
gm_changefreq ,
gm_show_qty_info ,
gm_sitemap_entry ,
products_image_w ,
products_image_h
)
VALUES (
'', '' , '' ,
".$row['anr']." , 0 , 0 , 0 , 0 , 0 ,
".$row['pic']." , ".$row['pre_a']." , 0 ,
".$row[DATUM].", "" , NULL , 1 , 1 , 1 ,
".$row['offen']." ,
".$row['offen']." , 0 ,
". sprintf("%01.4f", 0)." ,
0 , 0, 0 , sprintf("%01.4f", 0) ,
0 , 0 ,NULL ,NULL, 0 , NULL,
NULL , NULL ,". sprintf("%01.4f", 1)." ,
".sprintf("%01.4f", 1)." ,
NULL ,"0.5" ,"daily" ,NULL ,
"1" , 100 , 100
)";
Kommentar