PHP & MySQL storing multiple values in a database.
Posted
by R.I.P.coalMINERS
on Stack Overflow
See other posts from Stack Overflow
or by R.I.P.coalMINERS
Published on 2010-04-25T22:43:29Z
Indexed on
2010/04/25
22:53 UTC
Read the original article
Hit count: 154
I'm basically a front end designer and new to PHP and MySQL but I want a user to be able to store multiple names and there meanings in a MySQL database table named names
using PHP I will dynamically create form fields with JQuery every time a user clicks on a link so a user can enter 1 to 1,000,000 different names and there meanings which will be stored in a table called names
.
All I want to know is how can I store multiple names and there meanings in a database and then display them back to the user for them to edit or delete using PHP MySQL?
I created the MySQL table already.
CREATE TABLE names (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
userID INT NOT NULL,
name VARCHAR(255) NOT NULL,
meaning VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
Here is the HTML.
<form method="post" action="index.php">
<ul>
<li><label for="name">Name: </label><input type="text" name="name" id="name" /></li>
<li><label for="meaning">Meaning: </label><input type="text" name="meaning" id="meaning" /></li>
<li><input type="submit" name="submit" value="Save" />
<input type="hidden" name="submit" value="true" /></li>
</ul>
</form>
© Stack Overflow or respective owner