Thank you!

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 !! Delivery ------ solution -------------------- the information is incomplete at all. The preceding 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. Therefore, when you generate a list, add an if ($ row [xxx] and ask for help. thank you !!

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
------ 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.
------ Solution --------------------
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.
------ Solution --------------------
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 nameEcho "\ 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 ();


?>
------ Solution --------------------
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]";
}
Also use this page to receive:
If (isset ($ _ GET ))
{
$ Status = $ _ GET ['status'];
$ Userid = $ _ GET ['userid'];
// Then write an 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
------ Solution --------------------

If ($ I = (mysql_num_fields ($ user_query)-1 )){

If ($ row [$ I] = 1 ){
Echo 'reviewed';
} Else {
Echo 'unreviewed';

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.