Thank you for your help !! -Php Tutorial

Source: Internet
Author: User
Thank you for your help !! I want to make it a button under review and click review. It's just that my code won't be implemented. how can I add a button and how can I do it? big brother and big sister can help me !! Score delivery


Reply to discussion (solution)

The information provided is incomplete.
Probably as follows:
The above figure shows the data you read cyclically. 1 indicates that the data has passed the review, and 0 indicates that the data has not been reviewed,
So when you generate a list, you need to add a judgment.
If ($ row ['XXX'] = '1 '){
Echo 'reviewed ';
} Else {
Echo 'review ';
}
It is equivalent to an edited page.
Method 2: Use ajax directly.

The information provided is incomplete.
Probably as follows:
The above figure shows the data you read cyclically. 1 indicates that the data has passed the review, and 0 indicates that the data has not been reviewed,
So when you generate a list, you need to add a judgment.
If ($ row ['XXX'] = '1 '){
Echo 'reviewed ';
} Else {
Echo 'review ';
}
It is equivalent to an edited page.
Method 2: Use ajax directly.
The data circulating above is just the one that you want to add a button on the page for manual review. how can we add it? or I will stick the code here for you to see

Echo'Button'
The value obtained when you click it is uploaded to php using ajax for processing. modifying the data status to 1 indicates that the value has been reviewed. the default value of the core is 0.

Echo'Button'
The value obtained when you click it is uploaded to php using ajax for processing. modifying the data status to 1 indicates that the value has been reviewed. the default value of the core is 0.

Let's take a look at the code. I'm a newbie.

Error_reporting (E_ALL &~ E_NOTICE );
// Session_start ();

// Check whether logon is performed. If no logon is performed, the logon page is displayed.
// If (! Isset ($ _ SESSION ['userid']) {
// Header ("Location: login.html ");
// Exit ();
//}

// Contains the database connection file
Include ('connect. php ');
// $ Userid = $ _ SESSION ['userid'];
// $ Username = $ _ SESSION ['username'];
$ User_query = mysql_query ("select UserName, RealName, Department, PassWord, Email, MyGroup, WorkPhone, HomePhone, MobilePhone, CurrentTime, EndTime, Status from userinfo order by id asc ");
$ Row = mysql_fetch_array ($ user_query );
Echo'






















































';// Display the field name Echo "\ n \ N ";Switch (mysql_field_name ($ user_query, $ I )){Case Id:Echo' \ N ";Case UserName:Echo' \ N ";Case RealName:Echo' \ N ";Case Department:Echo' \ N ";Case PassWord:Echo' \ N ";Case Email:Echo' \ N ";Case MyGroup:Echo' \ N ";Case WorkPhone:Echo' \ N ";Case HomePhone:Echo' \ N ";Case MobilePhone:Echo' \ N ";Case CurrentTime:Echo' \ N ";Case EndTime:Echo' \ N ";Case Status:Echo' \ N ";} Echo" \ N "; If (mysql_fetch_row ($ user_query) = "0 "){Echo "no record! ";Exit;} // Locate the first recordMysql_data_seek ($ user_query, 0 );// Retrieve records cyclicallyWhile ($ row = mysql_fetch_row ($ user_query )){Echo" \ N ";For ($ I = 0; $ I{ Echo' ';}Echo" \ N ";} Echo"
'.
"ID ";
Echo"
'.
"User name ";
Echo"
'.
"Real name ";
Echo"
'.
"Department ";
Echo"
'.
"Password ";
Echo"
'.
"Email ";
Echo"
'.
"Group ";
Echo"
'.
"Work phone number ";
Echo"
'.
"Home Phone ";
Echo"
'.
"Mobile phone ";
Echo"
'.
"Registration time ";
Echo"
'.
"End time ";
Echo"
'.
"Review ";
Echo"
';
Echo "$ row [$ I]";
Echo'
\ N ";

// Release resources
Mysql_free_result ($ user_query );
// Close the connection
Mysql_close ();

?>

Error_reporting (E_ALL &~ E_NOTICE );
// Session_start ();

// Check whether logon is performed. If no logon is performed, the logon page is displayed.
// If (! Isset ($ _ SESSION ['userid']) {
// Header ("Location: login.html ");
// Exit ();
//}


// Contains the database connection file
Include ('connect. php ');
// $ Userid = $ _ SESSION ['userid'];
// $ Username = $ _ SESSION ['username'];
$ User_query = mysql_query ("select UserName, RealName, Department, PassWord, Email, MyGroup, WorkPhone, HomePhone, MobilePhone, CurrentTime, EndTime, Status from userinfo order by id asc ");
$ Row = mysql_fetch_array ($ user_query );


Echo'
























































';// Display the field name Echo "\ n \ N ";Switch (mysql_field_name ($ user_query, $ I )){Case Id:Echo' \ N ";Case UserName:Echo' \ N ";Case RealName:Echo' \ N ";Case Department:Echo' \ N ";Case PassWord:Echo' \ N ";Case Email:Echo' \ N ";Case MyGroup:Echo' \ N ";Case WorkPhone:Echo' \ N ";Case HomePhone:Echo' \ N ";Case MobilePhone:Echo' \ N ";Case CurrentTime:Echo' \ N ";Case EndTime:Echo' \ N ";Case Status:Echo' \ N ";} Echo" \ N "; If (mysql_fetch_row ($ user_query) = "0 "){Echo "no record! ";Exit;} // Locate the first recordMysql_data_seek ($ user_query, 0 );// Retrieve records cyclicallyWhile ($ row = mysql_fetch_row ($ user_query )){Echo" \ N ";For ($ I = 0; $ I{ Echo' ';}Echo" \ N ";} Echo"
'.
"ID ";
Echo"
'.
"User name ";
Echo"
'.
"Real name ";
Echo"
'.
"Department ";
Echo"
'.
"Password ";
Echo"
'.
"Email ";
Echo"
'.
"Group ";
Echo"
'.
"Work phone number ";
Echo"
'.
"Home Phone ";
Echo"
'.
"Mobile phone ";
Echo"
'.
"Registration time ";
Echo"
'.
"End time ";
Echo"
'.
"Review ";
Echo"
';
If ($ I = (mysql_num_fields ($ user_query)-1 )){
Echo $ row [$ I]."";
} Else {
Echo "$ row [$ I]";
}

Echo'
\ N ";

// Release resources
Mysql_free_result ($ user_query );
// Close the connection
Mysql_close ();


?>


Now there is something on it. could you help me with it? how can I review it? The field in the database is Status. I thought it was to click the button next to it. after review, keep it and modify the database field. the page is reviewed. thank you! I will give you more points.

Write a link as you said!

If ($ I = (mysql_num_fields ($ user_query)-1) {// index. php is equivalent to your current. php file echo"";}Else {echo" $ row [$ I] ";}use this page to receive: if (isset ($ _ GET )) {$ status = $ _ GET ['status']; $ userid = $ _ GET ['userid']; // then write the SQL statement update tablename set status = $ status where userid = $ userid ;}

The above is just to provide you with this idea, the code is not processed, you still need to tune your own in practical use

If ($ I = (mysql_num_fields ($ user_query)-1) {if ($ row [$ I] = 1) {echo 'reviewed';} Else {echo' not reviewed';}} Else {echo "$ row [$ I]";}
 

If ($ I = (mysql_num_fields ($ user_query)-1) {if ($ row [$ I] = 1) {echo 'reviewed';} Else {echo' not reviewed';}} Else {echo "$ row [$ I]";}
 
Thank you! Yes, it is. However, there is still a problem in saving the error. Thank you very much.

What kind of form do I want to add a check box in front of? how can I achieve this? can I add your [wzb0712] qq ??

If ($ I = (mysql_num_fields ($ user_query)-1) {if ($ row [$ I] = 1) {echo 'reviewed';} Else {echo' not reviewed';}} Else {echo "$ row [$ I]";}
 
The eldest brother is not here. please take a look. I am in a hurry. Thank you!

Isn't it easy to add a check box? See the html basics

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.