Problem sending mysql database
I have a little trouble with a script for sending mail and adding data in a database, sending mail that is properly but no record is created in the mysql table
PHP Code:
<? php
$name_radio = $_POST ['name_radio'];
$name = $_POST ['name'];
$first_name = $_POST ['firstname'];
$function = $_POST ['function'];
$category = $_POST ['category'];
$address = $_POST ['address'];
$PostalCode = $_POST ['PostalCode'];
$city = $_POST ['city'];
$country = $_POST ['country'];
$email = $_POST ['email'];
$code_license = $_POST ['code_license'];
$code_crypt = $_POST ['code_crypt'];
$quicontact = "radiowinners@gmail.com";
$headers = 'From: "RadioWinners" <registration@radiowinners.com>'. "\n";
$headers .= 'Content-Type: text/html; charset = "utf-8"'. "\n";
$headers .= 'Content-Transfer-Encoding: 8bit';
$message = '<html> <head>
</head> <body>
<p> Hi, </p>
<p> You receive this email just because a person \ ' record Radio Winners. </p>
<img <p> src="http://www.radyonne.com/images/mail/bas-sep.jpg" width="700" height="1"> </p>
Name <p> <strong> radio: </strong> '. $name_radio.' </p>
<p> <strong> Name: </strong> '. $name.' </p>
<p> <strong> First Name: </strong> '. $firstname.' </p>
<p> <strong> Function: </strong> '. $function.' </p>
<p> <strong> Category: </strong> '. $category.' </p>
<p> <strong> Address: </strong> '. $address.' </p>
<p> <strong> Postcode: </strong> '. $PostalCode.' </p>
<p> <strong> City: </strong> '. $city.' </p>
<p> <strong> Country: </strong> '. $country.' </p>
<p> <strong> Email: </strong> '. $email.' </p>
</p>
LICENSE <p> <strong> Code: </strong> '. $code_license.' </p>
<p> <strong> encrypted code: </ strong> '. $code_crypt.' </p>
<img <p> src="http://www.radyonne.com/images/mail/bas-sep.jpg" width="700" height="1"> </p>
</p>
</body> </html> ';
mail (''. $quicontact.'' 'Registration RADIO WINNERS', $message, $headers);
Mysql_connect ( "gffgfgfg", "fgfgfg", "fgfgf");
mysql_select_db ( "fgfgfgf");
mysql_query ( "INSERT INTO radiowinners VALUES ('', '". $name_radio. "', '". $name. "', '". $first_name. "', '". $function. "', '". $category. " ','". $address. " ','". $PostalCode. " ','". $city. " ','". $country. " ','". $email. " ' , ' ". $code_license."', ' ". $code_crypt."', '. "time ()."') ");
?>
Re: Problem sending mysql database
Add
Code:
or die (mysql_error ());
after your MySQL functions, it maybe give a hint about the problem.
Re: Problem sending mysql database
you will create a file:
_connection.php
PHP Code:
<? php
$host ='*****';
$user ='****';
$pass ='';
$dbase = '******' ;
// Connect to server
$connection = mysql_connect ($host , $user , $pass) or die ("Connection Error");
mysql_select_db ($dbase, $connection) or die ("Error connecting database");
?>
And in your pages you will just have to make (early):
PHP Code:
<? php
// Connection comics
include ( "_connection.php");
?>
That avoids for all your login codes written in clear in all your pages!
Re: Problem sending mysql database
Thank you
I found my mistake! I got the error message:
Unknown column 'email' in 'field list'