Logo - MyWebsolution.de
User gesamt  :  2376268
User online  :  1
KubaSeoTräume, PHP Forum, PHP Community and more ... MyWebsolution.de!
   
   
 
Registrieren Login User F.A.Q Suche Home

eingeloggt bleiben

MyWebsolution.de Foren » Anfängerfragen PHP und MYSQL » parse error im Insert SQL

Seite: 1 Posts pro Seite: 5 10 20
Autor Thread
28.10.2008 16:01 Uhr parse error im Insert SQL
webdino
User
 
registriert 28.10.2008
wohnt in
Beiträge 1
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?

PHP:

$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
)";



Profil ansehen
28.10.2008 21:38 Uhr
splasch
Forenposter
 
registriert 21.04.2008
wohnt in
Beiträge 67
Meinst net das du da zuviele Spalten für eine Tabelle hast. Schon mal über normaliesieren einer Datenbank nachgedacht!

Mfg Splasch
Profil ansehen
28.10.2008 23:27 Uhr
Flitze
Administrator
registriert 17.10.2006
wohnt in Eschwege
Beiträge 332
setz mal single quotes (also ' ) vor und hinter die doublequotes ( " )

PHP:
<?php
//statt

   
".$row['anr']." ,

//das hier
   
'".$row['anr']."' ,

// bei allen double quotes, also auch bei den sprintf
?>



Profil ansehen Mail senden
Seite: 1 no reply
Powered by Pascal Landau © 2006 MyWebsolution.de
Designed by Pascal Landau © 2006 MyWebsolution.de
 
 
 
 
Home Email Impressum Disclaimer Statistik