Question

  Asked: Jan 30 2008   5:45 PM GMT
  Asked by: MarkG713


Creating forms with PHP and MySQL


PHP, MySQL, Development, Linux

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?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


Start this Answer and Earn your Knowledge Points!

By clicking "Create Answer", you can write the answer to this question that can be improved upon by your peers using the Answer Wiki.

Browse more Questions and Answers on Development, Database and Linux.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

YuvalShavit  |   Jan 30 2008  8:52PM GMT

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