Tunes Posted December 28, 2006 Share Posted December 28, 2006 I have created a Table in mysql named creating_members and i would like to populate it is this code correct<?php$link = mysql_connect('localhost', 'root', 'tunes');if (!$link) { die('Could not connect: ' . mysql_error());}// make TMP the current db$db_selected = mysql_select_db('TMP', $link);if (!$db_selected) { die ('Can\'t use TMP Database : ' . mysql_error()); }else{ print("Connection Successful to TMP database");}//add the new information into the database$query="INSERT INTO creating_members (first_name,last_name,email_address,country_state,comments) VALUES('$_POST[first_name]','$_POST[last_name]','$_POST[email_address]','$_POST[country_state]','$_POST[comments]')";if(!mysql_db_query($dbname,$query,$link_id)) die(mysql_error());echo " success indatabase entry.";echo "<br />";echo "<a href=\"form_page.php\">Click here to return to the form page.</a>";?> Quote Link to comment Share on other sites More sharing options...
fenway Posted December 30, 2006 Share Posted December 30, 2006 Looks fine to me... is it not working for you? 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.