English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am trying to use a webform to post data to my MySQL database. I have all of this set up on my website that is hosted on yahoo. I have php MyAdmin installed on the server to manage the database. For some reason, I can't get my webform to post the info to my database. Can anyone help?

2006-08-29 08:59:59 · 3 answers · asked by eric j 2 in Computers & Internet Programming & Design

3 answers


// assuming you are posting a field called 'first_name'
$first_name =$_POST['first_name'];


//use proper values for mysql_user and mysql_password
//use proper value for localhost, if you are not using local host.



$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}


//assuming you are entering this field in a table called 'myfriends'
$query = "INSERT INTO myfriends(first_name) VALUES('$first_name')";


mysql_query($query);

mysql_close($link);
?>

2006-08-29 09:28:08 · answer #1 · answered by LorettoBoy 4 · 0 0

you will possibly desire to layout the database - that basically takes concept and, according to threat, paper and a pen. Designing the internet internet site demands graph paper. coming up the internet internet site desires paper. as quickly as you have executed all that, you enter the code for the internet site right into a record, create any photos and create the database and tables. coming up a internet website is something you do on your recommendations, no longer on a working laptop or pc. taking part in at internet layout is something you do without first coming up it.

2016-11-06 01:14:44 · answer #2 · answered by ? 4 · 0 0

try this
http://php.resourceindex.com/Documentation/Examples_and_Tutorials/Database_Manipulation/

2006-08-29 09:04:17 · answer #3 · answered by Judi V 2 · 0 0

fedest.com, questions and answers