Guarda a BD

PHP

Public Domain

Guarda a base de datos

Download (right click, save as, rename as appropriate)

Embed

1
2
3
4
5
6
7
8
$dbhost = 'localhost';
$dbuser = '';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = '';
mysql_select_db($dbname); 
$query = "INSERT INTO **tabla (**col,**col) VALUES ('".$_POST['**dato']."' , '".$_POST['**dato']."' , '".$_POST['email']."' , '".$_POST['msg']."')";
mysql_query($query) or die ("Failed to add stock list.<br />\n" . mysql_error() . "<br />\n$query");