How to add a form to a table and submit a MySQL database

Source: Internet
Author: User
Tags parse error
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 '
 
  
  "; $sql =" Select ID, schema, profit amount from ' org ' WHERE supervisor number = ' ". $q." ' "; $result = mysql_query ($sql), while ($row = Mysql_fetch_array ($result)) {echo ' 
    
      "; echo " 
     "; Echo ' 
     '; echo " 
    "; } echo " 
   
Architecture Profit Amount
" . $row [' Schema ']. "
";//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 '
 
  
  "; $sql = "Select ID, schema, profit amount from ' org ' WHERE supervisor number = '". $q. "'"; $result = mysql_query ($sql); while ($row = Mysql_fetch_array ($result)) {echo " 
    
      "; echo " 
     "; Echo ' 
     '; echo " 
    "; } echo " 
   
Architecture Profit Amount
" . $row [' Schema ']. "
"; Echo."'; Echo ''; Mysql_close ($con);? >


add.php
 
 
    


Thank you very much for your help.
  • Related Article

    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.