Class write error, how to read a group of data class_img.php & lt ;? Phpclass & nbsp; PicInfo {& nbsp; // & nbsp; $ SQL = & nbsp; "select & nbsp; * & nbsp; f class write error, how to read a group of data
Class_img.php
Class PicInfo
{
// $ SQL = "select * from userinfo where username = '$ name'"; // write SQL
Public function PicInfo ($ SQL)
{
Require_once ("db_config.php"); // contains the configuration information.
$ Result = mysql_query ($ SQL, $ conn); // execute the query statement
$ This-> picInfo = mysql_fetch_array ($ result); // return the query result to the array.
$ Num_rows = mysql_num_rows ($ result );
Mysql_query ("set names UTF8 ");
Mysql_close ($ conn); // Close the database connection
$ This-> getInfo ($ num_rows); // call the method for passing information.
}
// Obtain the method for passing information to the attribute
Private function getInfo ($ num_rows ){
$ This-> pid = $ this-> picInfo ["PID"];
$ This-> B _img = $ this-> picInfo ["B _img"];
$ This-> m_img = $ this-> picInfo ["M_img"];
$ This-> s_img = $ this-> picInfo ["S_img"];
$ This-> indicate = $ this-> picInfo ["Indicate"];
$ This-> type = $ this-> picInfo ["type"];
$ This-> row = $ this-> picInfo ['row'] = $ num_rows;
}
// Return the public method of each attribute.
Public function getRow (){
Return $ this-> row;
}
Public function getPid (){
Return $ this-> pid;
}
Public function getB_img (){
Return $ this-> B _img;
}
Public function getM_img (){
Return $ this-> m_img;
}
Public function getS_img (){
Return $ this-> s_img;
}
Public function getIndicate (){
Return $ this-> indicate;
}
Public function getType (){
Return $ this-> type;
}
}
Class edit_img
{
Public function edit_img ($ SQL)
{
Require_once ("db_config.php"); // contains the configuration information.
$ Result = mysql_query ($ SQL, $ conn); // execute the query statement
$ Row = mysql_affected_rows (); // return the query result to the array.
If ($ row <= 0)
{
Echo "script" alert ('no data inserted! ') Script ";
}
Else {
Echo "has". $ row. "the group data is affected ";