I am a novice, now want to do an indicator submission system, MySQL database has the overall structure of sales, and has been in PHP in accordance with the login account automatically generated corresponding sales subordinates, but the structure followed by sales indicators, want to make an input box, and submit to the database, how to do:
Architecture Profit Amount
-L4: Shanghai Wedding yellow supervisor Input Box
-L3: Shanghai Wedding 2 Group Shen Supervisor Input Box
-L2: Shanghai wedding 2-1 Group MA supervisor Input Box
L1: Sun Sales Input box
L1: Du sales input box
L1: Lee Sales input box
Schema Profit "; $sql =" Select architecture, profit from ' org ' WHERE supervisor number = ' ". $q." ' "; $result = mysql_query ($sql), while ($row = Mysql_fetch_array ($result)) {echo ""; echo "". $row [' Schema ']. ""; echo "";} echo ""; Mysql_close ($con);? >
Reply to discussion (solution)
I am a novice, now want to do an indicator submission system, please do it, send me:
I modified it on your base, the idea is??? The ID?? Submit.
index.php
add.php
Thanks for the reply, I'll try it tomorrow.
Perhaps I did not explain clearly, I put the entire system code combined with the code of the predecessor of the next:
Login interface (incomplete):
Indicator Collection System
welcome.php
Welcome
'; Echo '
Architecture |
Profit Amount |
"; $sql =" Select ID, schema, profit amount from ' org ' WHERE supervisor number = ' ". $q." ' "; $result = mysql_query ($sql), while ($row = Mysql_fetch_array ($result)) {echo '
"; echo "
" . $row [' Schema ']. " | "; Echo '
| '; echo "
"; } echo "
";//echo ''; Echo ''; Mysql_close ($con);? >
Add. Php
Error after running now: Parse error:syntax error, unexpected t_variable in D:\AppServ\www\add.php on line 24
How can i solve it?
24 Lines of
Profit amount = ' "$_post[' yl '. $row [' ID '].]" ' where
Switch
Profit amount = ' ". $_post[' yl '. $row [' ID ']]." ' Where
$SQLSTR = "Update ' org ' set profit = '" $_post[' yl '. $row [' ID '].] "' Where id= '". $row [' id ']. "'";
should be for
$SQLSTR = "Update ' org ' set Profit = '". $_post[' yl '. $row [' ID ']]. "' Where id= '". $row [' id ']. "'";
Thank you for your help, but there are still problems:
I have two tables in my database org:
1.user: There is a supervisor number, name, password, used as login account and password
2.org: There is ID (originally did not have this field, and later added to, in order to cooperate with the proud snow star Maple to give the code, since the addition of fields), architecture, profit amount
Now with the code that everyone gave me, or can not update the value of the profit of the database, and add.php finally add the jump page of that code, the actual page jump is not the original Supervisor login welcome.php interface, also please answer.
Thank you for your help, but there are still problems:
I have two tables in my database org:
1.user: There is a supervisor number, name, password, used as login account and password
2.org: There is ID (originally did not have this field, and later added to, in order to cooperate with the proud snow star Maple to give the code, since the addition of fields), architecture, profit amount
Now with the code that everyone gave me, or can not update the value of the profit of the database, and add.php finally add the jump page of that code, the actual page jump is not the original Supervisor login welcome.php interface, also please answer.
Dear predecessors, the current problem is in this code, but also how to modify to be based on the database ID corresponding to the profit amount to update:
if ($_post[. $row [' ID '].]) {$sqlstr = "update ' org ' set Profit = '". $_post[. $row [' id ']. "' Where id= '". $row [' id ']. "'"; /update into DB mysql_query ($sqlstr) or Die (Mysql_error ()); }
To see the jquery Easy UI the DataGrid is simple, loading the data also allows it to automatically increment the input box, requiring only one property
Long time, finally took care of himself, put the code:
welcome.php
Welcome
'; Echo '
Architecture |
Profit Amount |
"; $sql = "Select ID, schema, profit amount from ' org ' WHERE supervisor number = '". $q. "'"; $result = mysql_query ($sql); while ($row = Mysql_fetch_array ($result)) {echo "
"; echo "
" . $row [' Schema ']. " | "; Echo '
| '; echo "
"; } echo "
"; Echo."'; Echo ''; Mysql_close ($con);? >
add.php
Thank you very much for your help.