|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-05-14 10:47 UTC] nikunj dot vasani at flydocs dot aero
[2015-05-15 07:23 UTC] nikunj dot vasani at flydocs dot aero
[2015-05-15 20:44 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2015-05-15 20:44 UTC] cmb@php.net
[2015-05-24 04:22 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 18:00:01 2025 UTC |
Description: ------------ class DB { var $Link_ID = 0; var $Host = ""; var $Database = ""; var $User = ""; var $Password = ""; function DB_Sql($DBArray) { $this->connect($DBArray); } function connect($DBArray) { $this->Link_ID=0; if($DBArray!=NULL) { $this->Database=$DBArray["DATABASE"]; $this->Host=$DBArray["HOST"]; $this->User=$DBArray["USER"]; $this->Password=$DBArray["PASSWORD"]; } if ( 0 == $this->Link_ID ) { $this->Link_ID=mysqli_connect($this->Host, $this->User, $this->Password); if (!$this->Link_ID) { $this->halt("connect($Host, $User, \$Password) failed."); return 0; } if (!@mysqli_select_db($this->Link_ID,$this->Database)) { $this->halt("cannot use database ".$this->Database); return 0; } } return $this->Link_ID; } function query($Query_String,$where=NULL) { if ($Query_String == "") return 0; if(!$this->Link_ID) { if($this->type == "mysql") { if (!$this->connect()) { return 0; /* we already complained in connect() about that. */ }; } } if ($this->Query_ID) { @mysqli_stmt_free_result($this->Query_ID); } $strType=''; $this->Query_ID=mysqli_prepare($this->Link_ID,$Query_String) ; call_user_func_array('mysqli_stmt_bind_param', array_merge (array($this->Query_ID, $strType), $this->refValues($where))) ; } mysqli_stmt_execute($this->Query_ID) ; # Will return nada if it fails. That's fine. return $this->Query_ID; } } Test script: --------------- $db = new DB($DBArray); $db->query("select * from xyz"); // This is working fine. $db->Link_ID=0; $db->query("select * from abc"); // This is not working. I can not get any value of the column. Please Note : above code is already working fine in 5.4. By Testing we found that after remove @mysqli_stmt_free_result($this->Query_ID); line from free function, code is running properly.But for not all the sections. Please advice on this asap Thnaks