Page 1 of 1

Problem mit einfachen INSERT Into

Posted: Sat Feb 02, 2008 10:40 am
by felixg
Hallo,

ich versuche grade ganz normal mit ADODB ein paar Daten in meine Datenbank zu schreiben. Dies mache ich mit ADODB dem System halt entsprechend.

Aber es läuft nix. Es kommt kein Fehler und ich sitze jetzt schon 2 Tage daran, vielleicht kann wer helfen.

Code: Select all

<?php
if (!isset($gCms)) exit;

$db =& $gCms->GetDb();
if (!$this->CheckPermission('Use WsSpieler')) exit;


$error = FALSE;

if( isset($params['input_vorname']))
  {
    $vorname = $params['input_vorname'];
  echo "ok!1";
  }
 else
  {
    $error = true;
  } 

 $input_kuenstlername = ""; 
  
if( isset($params['input_kuenstlername']))
  {
    $kuenstlername = $params['input_kuenstlername'];
    echo "ok!2";
  }

 if( isset($params['input_nachname']))
  {
  echo "ok!3";
    $nachname = $params['input_nachname'];
  }
 else
  {
    $error = true;
  } 
  
   if( isset($params['input_national']) /*&& is_int($params['input_national'])*/)
  {
  echo "ok!4";
    $national = $params['input_national'];
  }
 else
  {
    $error = true;
  } 
  
   if( isset($params['input_position']))
  {
  echo "ok!5";
    $position = $params['input_position'];
  }
 else
  {
    $error = true;
  } 

  $bild = "keinbild.jpg";
  
  if( isset($params['input_bild']))
  {
    $bild = $params['input_bild'];
  } 
  
 if( isset($params['input_ausdauer']) /*&& is_int($params['input_ausdauer'])*/)
  {
  echo "ok!6";
    $ausdauer = $params['input_ausdauer'];
  }
 else
  {
    $error = true;
  } 
  
 if( isset($params['input_technik']) /*&& is_int($params['input_technik'])*/)
  {
  echo "ok!7";
    $technik = $params['input_technik'];
  }
 else
  {
    $error = true;
  } 
  
 if( isset($params['input_kopfball']) /*&& is_int($params['input_kopfball'])*/)
  {
  echo "ok!8";
    $kopfball = $params['input_kopfball'];
  }
 else
  {
    $error = true;
  }   
  
 if( isset($params['input_schusskraft']) /*&& is_int($params['input_schusskraft'])*/)
  {
  echo "ok!9";
    $schusskraft = $params['input_schusskraft'];
  }
 else
  {
    $error = true;
  }
  
 if( isset($params['input_frische']) /*&& is_int($params['input_frische'])*/)
  {
  echo "ok!10";
    $kopfball = $params['input_frische'];
  }
 else
  {
    $error = true;
  }

 if( isset($params['input_uebersicht']) /*&& is_int($params['input_uebersicht'])*/)
  {
  echo "ok!11";
    $uebersicht = $params['input_uebersicht'];
  }
 else
  {
    $error = true;
  }
  
 
  
  
  
  if (!$error)
    {
      $wsspieler_id = $db->GenID(cms_db_prefix()."module_wsspieler_seq");
      $sql = "INSERT INTO cms_module_wsspieler (id, vorname,kuenstlername,nachname,position,bild,geburtstag,national,ausdauer,frische,uebersicht.schusskraft,kopfball,technik) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
      $parms = array($wsspieler_id,$params['vorname'],$params['kuenstlername'],$params['nachname'],$params['position'],$params['bild'],$params['geburtstag'],$params['nationalität'],$params['ausdauer'],$params['frische'],$params['uebersicht'],$params['schusskraft'],$params['kopfball'],$params['technik']);
      $db->Execute($sql, $parms);
    
      $params = array('tab_message'=> 'spieleradd', 'active_tab' => 'list');
      $this->Redirect($id, 'defaultadmin', $returnid, $params);
    }
  else
    {
    echo "fehler!";
     // echo $this->ShowErrors($this->Lang('adderror'));
 
 //           $params = array('tab_message'=> 'spielererror', 'active_tab' => 'add');
   //   $this->Redirect($id, 'defaultadmin', $returnid, $params);
    }


?>
Hoffe irgendwem fällt irgendwas auf!

FelixG

Re: Problem mit einfachen INSERT Into

Posted: Sat Feb 02, 2008 6:32 pm
by NaN
Bin mir nicht ganz sicher, aber eventuell ist da nur ein kleiner Tippfehler:

Code: Select all


$sql = "INSERT INTO ... ,uebersicht . schusskraft, ...;

Sollte da nicht ein Komma zwischen uebersicht und schusskraft hin?