sivanath.nagendran Posted November 29, 2006 Share Posted November 29, 2006 Hi to all I am a newbie to php/mysql. Pls can anyone help me for this [b]" How to Get Data from HTML Listmenu then Insert into Database( Using PHP/MySQL) ".[/b] I mean If User select one option from Listmenu, then store that option value into Database using PHP/ MySQL.Advance thanks for helping.BySivanath.N :( Quote Link to comment Share on other sites More sharing options...
Caesar Posted November 29, 2006 Share Posted November 29, 2006 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_queryStart there...there are working examples and it will point you in the right direction through all the diferent mysql functions. Quote Link to comment Share on other sites More sharing options...
noldguy Posted November 29, 2006 Share Posted November 29, 2006 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. Quote Link to comment Share on other sites More sharing options...
sivanath.nagendran Posted November 29, 2006 Author Share Posted November 29, 2006 Sorry, But I know how to use the Form tag into html, but I dont know how to pick one selected value from Listmenu (like combo box) then insert into database.By Sivanath.N Quote Link to comment Share on other sites More sharing options...
sivanath.nagendran Posted November 29, 2006 Author Share Posted November 29, 2006 Hi sir I recieve the listmenu option values from database, now is it possible for my previous quistion? I mean selected option I need to be stored into database. Pls help me, sorry for my English.BySivanath.N Quote Link to comment Share on other sites More sharing options...
Caesar Posted November 30, 2006 Share Posted November 30, 2006 Can we see your existing code? We can point you in the right direction if we can see your existing code. Quote Link to comment Share on other sites More sharing options...
Greenie Posted November 30, 2006 Share Posted November 30, 2006 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. Quote Link to comment Share on other sites More sharing options...
sivanath.nagendran Posted November 30, 2006 Author Share Posted November 30, 2006 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 thisBySivanath.N Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.