note 101119 added to function.mysql-query

From: Date: Sat, 27 Nov 2010 14:57:58 +0000
Subject: note 101119 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-174395@lists.php.net to get a copy of this message
<? class db{ var $dbhost = 'localhost'; var $dbname = 'my_db'; var $dbuser = 'db'; var $dbpassword = 'password'; var $die_error = true; public function speed_sendRequest($request){ $this->speed_cnt = mysql_connect($this->dbhost,$this->dbuser,$this->dbpassword); // Gestisco la prima connessione al database mysql if(!$this->speed_cnt) { if($this->die_error){ die("Connection problems, try again! | Problemi di connessione, riprova!".mysql_error()); } return false; } $this->speed_dbselect = mysql_select_db($this->dbname, $this->speed_cnt); // Seleziono il database if(!$this->speed_dbselect) { if($this->die_error){ die("Problems during database selection! | Problemi durante la selezione del database!".mysql_error()); } return false; } $this->speed_result = mysql_query($request, $this->speed_cnt); if(!$this->speed_result) { if($this->die_error){ die("Problems during query execution! | Problemi durante l'esecuzione della richiesta!".mysql_error()); } return false; } else { return $this->speed_result; } } } $database = new db(); $x = $database->speed_sendRequest("Select * from reg_users"); while ($row = mysql_fetch_array($x)) { echo $row['UserName']; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 93.41.32.255 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-query.php Edit -- https://master.php.net/note/edit/101119 Del: integrated -- https://master.php.net/note/delete/101119/integrated Del: useless -- https://master.php.net/note/delete/101119/useless Del: bad code -- https://master.php.net/note/delete/101119/bad+code Del: spam -- https://master.php.net/note/delete/101119/spam Del: non-english -- https://master.php.net/note/delete/101119/non-english Del: in docs -- https://master.php.net/note/delete/101119/in+docs Del: other reasons-- https://master.php.net/note/delete/101119 Reject -- https://master.php.net/note/reject/101119 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#174395) next »