5 pts.
 Creating forms with PHP and MySQL
Using PHP and MySQL, I am trying to create a table form which can input multiple data within the form. When the space row provided is not enough, I want to add in another function which can help add rows in the same table. How can I do this?

Software/Hardware used:
ASKED: January 30, 2008  5:45 PM
UPDATED: March 16, 2010  6:12 PM

Answer Wiki:
Look to <a href="http://phpforms.net/tutorial/html-basics/php-forms.html">PHP Form Tutorial</a>. It's too long to write it here
Last Wiki Answer Submitted:  March 16, 2010  6:12 pm  by  Tudorol   185 pts.
All Answer Wiki Contributors:  Tudorol   185 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Could you clarify your question a bit? Are you trying to change the HTML form to make more space for the user to type, or are you trying to add a row to the database table?

If you’re trying to change the HTML form, you can either re-print it the page with the PHP or dynamically change the form with JavaScript (which is probably the better option for most applications).

If you’re trying to add rows to the database table, the SQL method for that is [b]INSERT into [i]table_name[/i] (“[i]column_1_name[/i]“, “[i]column_2_name[/i]” … ) values (“[i]column_1_data[/i]“, “[i]column_2_data[/i]” …);[/b] (replace the italic bits with the appropriate values). Make sure to sanitize your inputs so that hackers can’t mess around with the database. But what you put into your tables, and how you connect the various rows, depends more on your specific application. I’m not a SQL expert, but I think if you chose the right data types (like [i]text[/i] or [i]char/varchar[/i], you shouldn’t have issues with not enough space.

HTH — if I’ve misunderstood your question, please clarify and I’ll try a second go. :-)

Yuval

 905 pts.