okay so i found this code to make a confirmation number but my problem is i cant seem to enter it into my mysql database i was wondering if i was doing something wrong?
<?php
$con = mysql_connect("host","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("volunteer", $con);
[U]$string=mysql_real_escape_string($_POST['confirmation']); [/U]
$name=mysql_real_escape_string($_POST['name']);
$email=mysql_real_escape_string($_POST['email']);
$address=mysql_real_escape_string($_POST['address']);
$sql="INSERT INTO volunteer ([U]confirmation[/U],name,email,address) VALUES('[U]$string[/U]','$name','$email','$address')";
if (!mysql_query($sql,$con)) {
die('Error: ' . mysql_error());
}
?>
[B]
<?php
$string = "abcdefghijklmnopqrstuvwxyz0123456789";
for($i=0;$i<25;$i++){
$pos = rand(0,36);
$str .= $string{$pos};
}
echo $str;
?>[/B]
<?php
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$address = trim($_POST['address']);
$recipient = "email@domain.com";
$subject = "Volunteer";
$message = " ";
mail($recipient, $subject, $message);
?>
the bold is the code i found to make the number and the underlined area is what i used to try to put it into my mysql database. did i do something wrong?