![]() |
![]() ![]() |
![]() |
![]()
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 ![]() $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? -------------------- Sprawdź kiedy marzenia stają się inspiracją.
e-Zarządzania firmą | e-Biznes | Strony.Serwisy.Portale Internetowe www.webarts.pl |
|
|
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 15 467 Pomógł: 1451 Dołączył: 25.04.2005 Skąd: Szczebrzeszyn/Rzeszów ![]() |
Dodaj bbcode do treści listingu.
-------------------- ![]() ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW! |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 6 Pomógł: 0 Dołączył: 15.02.2008 Ostrzeżenie: (0%) ![]() ![]() |
Literówka
![]() __contruct -> __construct |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 19.07.2025 - 19:12 |