-1
Hallo, wie zum Aktualisieren der aktive Spalte in der Tabelle scheint nicht mein Codewie die aktiven Spalt
db.php `öffentliche Funktion aktiv ($ table, $ id, $ Felder, $ activecode) arbeiten zu aktualisieren { $ set = ''; $ x = 1;
foreach($fields as $name => $value){
$set .= "{$name} = ?";
if($x < count($fields)) {
$set .= ', ';
}
$x++;
}
$sql = "UPDATE {$table} SET {$set} WHERE id = {$id} AND activecode = {$activecode}";
if(!$this->query($sql, $fields)->error()){
return true;
}
//return false;
}`
activate.php
`require_once 'Kern/init.php';
if(Input::exists()){
if(Token::check(Input::get('token'))){
$validate = new Validate();
$validation = $validate->check($_POST, array(
'id' => array('required' => 'true'),
'activecode' => array('required' => 'true')
));
if($validation->passed()){
$user = new User();
$user->active(array(
'active' => 1
));
Session::flash('success', 'success.');
Redirect::to('index.php');
}else{
echo "error";
}
}else{
pre($validation->errors());
}
}`
Aktivierungslink Activate.php? Aktiv =. $ Activecode. . & id = $ id
funktioniert nicht! php CURD ist ein Denksport lol – sami
wenn Sie $ sql Echo, was ist die Ausgabe? –
hier ist der vollständige Code DB.php => https://codepad.remoteinterview.io/playback/XWOYTUNPPQ init.php => https://codepad.remoteinterview.io/playback/UODTAEPFNH activate.php => https://codepad.remoteinterview.io/playback/XXTXERDRDZ danke für deine Antwort @Chad Skiles – sami