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'
'. "ID "; Echo" | \ N ";Case UserName:Echo'
'. "User name "; Echo" | \ N ";Case RealName:Echo'
'. "Real name "; Echo" | \ N ";Case Department:Echo'
'. "Department "; Echo" | \ N ";Case PassWord:Echo'
'. "Password "; Echo" | \ N ";Case Email:Echo'
'. "Email "; Echo" | \ N ";Case MyGroup:Echo'
'. "Group "; Echo" | \ N ";Case WorkPhone:Echo'
'. "Work phone number "; Echo" | \ N ";Case HomePhone:Echo'
'. "Home Phone "; Echo" | \ N ";Case MobilePhone:Echo'
'. "Mobile phone "; Echo" | \ N ";Case CurrentTime:Echo'
'. "Registration time "; Echo" | \ N ";Case EndTime:Echo'
'. "End time "; Echo" | \ N ";Case Status:Echo'
'. "Review "; 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'
'; If ($ I = (mysql_num_fields ($ user_query)-1 )){ Echo $ row [$ I].""; } Else { Echo "$ row [$ I]"; }
Echo' | ';}Echo"
\ N ";}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';