Witam mam problem. Otóż miałem bardzo fajny formularz zgłoszeniowy, jednak przez przypadek skasowałem w bazie jakieś tabele. Możecie mi podać kod do phpmyadmina, żebym wykonał i mi wszystko ok działało. Podejrzewam że w bazie skasowałem tabelę ankieta, ale zrobiłem ją i nadal coś nie tak. Adres do przeglądania tego forumularza
http://www.agencja-quest.com/adm/ Oto kod z pliku administracyjnego.
//Include database info
include("dbconfig.php");
//print("Startup... <br>");
class admin {
function admin() {
//Connect to MySQL and select database
//print(DB_HOST .", ". DB_NAME .", ". DB_USER . "<br>");
}
function doPost($in) {
// Create SQL statement
$sql = sprintf("INSERT INTO ankieta VALUES (" . "'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'," .
"'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'," .
"'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'," .
"'%s', '%s', '%s', '%s', NULL );" ,
$this->escape($in['imie']) , $this->escape($in['dataur']) ,
$this->escape($in['zameld']) , $this->escape($in['zamieszk']) ,
$this->escape($in['teldom']) , $this->escape($in['telkom']) ,
$this->escape($in['email']) , $this->escape($in['pesel']) ,
$this->escape($in['dowod']) , $this->escape($in['nip']) ,
$this->escape($in['wykrztalc']) , $this->escape($in['imrodzic']) ,
$this->escape($in['pracnauka']) , $this->escape($in['legit']) ,
$this->escape($in['umcechy']) , $this->escape($in['dyspozyc']) ,
$this->escape($in['wzrost']) , $this->escape($in['waga']) ,
$this->escape($in['ubranie']) , $this->escape($in['biust']) ,
$this->escape($in['pas']) , $this->escape($in['biodra']) ,
$this->escape($in['sanepid']) , $this->escape($in['sanit']) ,
$this->escape($in['bhp']) , $this->escape($in['prjazdy']) ,
$this->escape($in['samoch']) , $this->escape($in['samochmarka']) ,
$this->escape($in['kontotn']) , $this->escape($in['kontoadr']) ,
$this->escape($in['kontonr']) , $this->escape($in['kontobank']) ,
$this->escape($in['urzskarb']) , date("Y-m-d") );
//print($sql . " effect:". $result . "<br>");
// Check to see if the query did what it should have and return
return array("status" => "success"); } else {
return array("status" => "fail"); }
}
function doRead($i) {
// Create SQL query
$sql = sprintf("SELECT * FROM `ankieta` ORDER BY id;"); // Run query on database
// Return result
return $this->data;
}
function dele($i) {
$sql = sprintf("DELETE * FROM `ankieta` WHERE `ankieta.id`=".$i." LIMIT 1;"); // Run query on database
// Return result
return $this->result;
}
function rows() {
// Create SQL query
$sql = sprintf("SELECT * FROM `ankieta`;"); // Run query on database
// Return result
return $this->number;
}
function escape($string)
{
}
}
//$blah = new admin();
//$blee['imie'] = "Cos";
//$blah->doPost($blee);
//$blah->doRead();