Ich habe ein Problem beim Einfügen von Daten in die Datenbank, es wird kein Fehler angezeigt, aber die Daten werden nicht in die Datenbank eingefügt.Daten werden nicht in die Datenbank eingefügt, es wird kein Fehler angezeigt
-Controller-Code
function FormData($data){
if (!empty($_POST['name'])) {
$data = array(
'name' => $this->input->post('name'),
'position' => $this->input->post('position'),
'about_me' => $this->input->post('about_me'),
'contact_me' => $this->input->post('contact_me'),
'email' => $this->input->post('email'),
'temp_addr' => $this->input->post('temp_addr'),
'perm_addr' => $this->input->post('perm_addr'),
'skill' => $this->input->post('skill'),
'photo' => $this->input->post('photo'),
);
$this->Maboutus->form_insert($data);
redirect('/admin');
}
}
Model Code
function form_insert($data){
$this->db->insert('aboutus',$data);
}
anzeigen Datei
<div class="container">
<div class="col-md-8">
<form action="#" method="POST" class="form-horizontal">
<div class="col-md-12">
<div class="form-group">
<lebel for="name" class="col-md-4" >Name :</lebel>
<input type="text" name="name" id="name" class="col-md-8" placeholder="your name " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >Position :</lebel>
<input type="text" name="position" id="position" class="col-md-8" placeholder="your position " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >About Me :</lebel>
<input type="text" name="about_me" id="about_me" class="col-md-8" placeholder=" your name About me " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >Mobile No :</lebel>
<input type="text" name="contact_me" id="contact_me" class="col-md-8" placeholder=" your Mobile number" required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >Email :</lebel>
<input type="text" name="email" id="email" class="col-md-8" placeholder=" your email " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >Temporary Addr :</lebel>
<input type="text" name="temp_addr" id="temp_addr" class="col-md-8" placeholder=" your Temporary Address " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >Permanent Addr :</lebel>
<input type="text" name="perm_addr" id="perm_addr" class="col-md-8" placeholder=" your Permanent Address " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<lebel for="position" class="col-md-4" >Skill :</lebel>
<input type="text" name="skill" id="skill" class="col-md-8" class="col-md-8" placeholder="your skill " required>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="form-group">
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" class="col-md-8" name="photo" id="photo">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input class="col-md-8" class="btn btn-primary" type="submit" value="Submit"></br></br>
</div>
</div>
</form>
</div>
: Ich bin in ph p, Daten werden nicht in die Datenbank eingefügt, und es zeigt keinen Fehler, was kann ich tun? bitte jemand mir helfen. Ich habe versucht, zu suchen, aber ich finde nichts falsch .. helfen Sie mir aus diesem Problem
Schalten e hinzufügen Rror Berichterstattung durch Hinzufügen dieser 'error_reporting (E_ALL);' in Ihrer Datei index.php –
ich versuchte, aber nichts bekommen –
Was ist das '$ data' hier ->' function FormData ($ data) {'? Sie geben diese URL nicht in Form weiter und laden auch keine Ansicht in diese Methode. – Tpojka