Class is wrong, how to read a group of data

Source: Internet
Author: User
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 ";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.