![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 66 Pomógł: 1 Dołączył: 28.02.2007 Skąd: Kraków Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Cały czas dostaje komunikat o błędnym\nieznanym linku do bazy. Skrypt wyglada tak: <?php /* DB connector by Jakub Mróz (www.webArts.pl) Class responsible for database connections release 03.09.v1b */ class dbconn { protected $link; private $server, $username, $password, $db; public function __contruct($server, $username, $password, $db) { $this->server = $server; $this->username = $username; $this->password = $password; $this->db = $db; $this->connect(); } public function __destruct() { mysql_close($this->link); } /* Database connect function */ private function connect() { $this->link = mysql_connect($this->server, $this->username, $this->password); mysql_select_db($this->db, $this->link); } /* Simple SQL Fetcher Returns: sql execution result */ public function execute($sql) { $this->connect(); return mysql_query($sql, $this->link); } /* Registrations of a new patient */ public function regPatient($firstname, $surname, $weight, $pesel) { // jacob's Simple Anty-hack tool (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) $firstname=addslashes($firstname); $secondname=addslashes($secondname); # Must be . in float $weight = (float)str_replace(",",".",$weight); //if ( (($weight>=0.100) && ($weight<=500.000)) && !empty($firstname) && !empty($surname) && (strlen($pesel)==11) ) //{ return $this->execute("INSERT INTO patient(firstname, surname, weight, pesel) VALUES('$firstname','$secondname',".(float)$weight.", ".(int)$pesel.")"); //} else { //return 'err'; //} } } ?> co jest nie tak? |
|
|
![]() |
![]() ![]() |
![]() |
Aktualny czas: 4.10.2025 - 21:00 |