Jump to content

How to Get Data from HTML Listmenu then Insert into Database( Using PHP/MySQL)


sivanath.nagendran

Recommended Posts

This depends what method you're using. Post? Get? Also....this would entail the very very basics of PHP. I suggest before diving in blindly...to at least do a little reading.

Take a look at:

http://us2.php.net/mysql_query

Start there...there are working examples and it will point you in the right direction through all the diferent mysql functions.
Link to comment
Share on other sites

Agree with Caeser. The question is way too broad and open ended. It requires (1) knowing how to create HTML forms using the <form> tag and writing a php routine that will (2) validate the data from the submitted form and (3) update the database. That's three different areas of knowledge you have to know.

Suggest you do a search for on the terms "php" and "tutorial" and wade through the results. It will take doing your homework, but you'll find what you need to know.
Link to comment
Share on other sites

Hey sivanath,

w3schools.com has [url=http://www.w3schools.com/php/php_mysql_insert.asp]a tutorial[/url] that explains how to add to your database using some input boxes. Once you know how to do this, it's not too hard to apply it to a list box. It skips over evaluating the input, though. But it will get you off to a good start and should show some results pretty quickly.
Link to comment
Share on other sites

Hi CAESAR

    <?php $sql = "SELECT eventType FROM srt_eventType";
$result = mysql_query($sql) or die ($sql . '<br />' . mysql_error);
if (!$result) {
echo 'Query failed';
exit;
}
if (mysql_num_rows($result)>0) {
echo '<select name="eventType">';
while($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['eventType'] . '">' . $row['eventType'] . '</option>';
}
echo '</select>';
} else {
echo 'No eventType created yet';
}
?>


I used this code for getting data from MySQL then insert that into Listmenu. Now I need help for how to I store the selected Item from Listmenu to Database?

Help me for this

By
Sivanath.N
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.