Working with massive?

Guys, there is a class in php msyql

<?php<br>
class MumbuDB {<br>
/**<br>
 * Link connection<br>
*/<br>
 public $db_link;<br>
<br / >
/**<br>
 * Debug mode<br>
*/<br>
 public $debugging = true;<br>
<br / >
/**<br>
 * Queries<br>
*/<br>
 public $list_queries = array();<br>
<br / >
/**<br>
 * Connect to MySQL<br>
*/<br>
 public function connect($DB_HOST,$DB_USER,$DB_NAME,$DB_PASSWORD){<br>
<br / >
$this->db_link = mysql_connect($DB_HOST,$DB_USER,$DB_PASSWORD) or $this->error("Not possible to connect to MySQL server");<br>
 mysql_select_db($DB_NAME) or $this->error('Not possible to select database "'.$DB_NAME.'"');<br>
 mysql_query("SET NAMES UTF8");<br>
<br / >
}<br>
<br / >
/**<br>
 * Analogue mysql_num_rows<br>
*/<br>
 public function mumbu_sql($sql){<br>
 # Note the time of query execution<br>
 $start_time = microtime(true);<br>
<br / >
# Execute the query<br>
 $result = mysql_query($sql, $this->db_link) or $this->error($sql . PHP_EOL . mysql_error($this->db_link));<br>
<br / >
# Get the time at the end of the request<br>
 $end_time = microtime(true);<br>
<br / >
# Calculate the time it takes to query<br>
 $query_time = $end_time - $start_time;<br>
<br / >
$this->list_queries[] = array(<br>
 'query' => $query,<br>
 'time' => $query_time<br>
);<br>
<br / >
return $result;<br>
<br / >
}<br>
<br / >
/**<br>
 * Analogue mysql_num_rows<br>
*/<br>
 public function mumbu_num_rows($sql){<br>
<br / >
return mysql_num_rows($this->mumbu_sql($sql));<br>
<br / >
}<br>
<br / >
/**<br>
 * Analogue mysql_result<br>
*/<br>
 public function mumbu_one($sql){<br>
<br / >
return mysql_result($this->mumbu_sql($sql),0);<br>
<br / >
}<br>
<br / >
/**<br>
 * Analogue mysql_fetch_assoc<br>
*/<br>
 public function mumbu_fetch($sql){<br>
<br / >
return mysql_fetch_assoc($this->mumbu_sql($sql));<br>
<br / >
}<br>
<br / >
/**<br>
 * The last inserted id<br>
*/<br>
 public function insert_id() {<br>
 return mysql_insert_id($this->db_link);<br>
}<br>
<br / >
/**<br>
 * Close connection<br>
*/<br>
 public function close(){<br>
 if($this->db_link) mysql_close($this->db_link);<br>
 $this->db_link = NULL;<br>
exit;<br>
}<br>
<br / >
/**<br>
 * Output the error and shutdown<br>
*/<br>
 protected function error($error){<br>
 if($this->debugging) print "<pre>". $error ."</pre>";<br>
exit;<br>
}<br>
<br / >
}<br>
?><br>



next do the query:

$DB = new MumbuDB();<br>
$DB->connect($dbhost, $dbuser, $dbname, $dbpassword);<br>
$sql = ('SELECT * FROM `Candidate`);<br>
$ls = $DB->mumbu_fetch($sql);<br>
print_r($ls);



the result:
Array ( [id_candidate] => 1 [fio] => Suraev [sex] => M [age] => 23 [visa] => MO [contacts] => 8988888888 [email] => mail@mail.ru [post] => President [income] => 10000000 [note] => ddcdcdcd )



I can not understand how to withdraw the item from the array, prompt
October 8th 19 at 03:09
2 answers
October 8th 19 at 03:11
Solution
while ($ls = $DB->mumbu_fetch($sql)) {
echo $ls['fio'];
}
October 8th 19 at 03:13
echo $ls['fio'];<br>

In my opinion it is obvious...
empty - ryan44 commented on October 8th 19 at 03:16

Find more questions by tags MySQLPHP