Jump to content

[SOLVED] INSERTING INTO DATABASE


pgrevents

Recommended Posts

<?php

if ($_POST['part1'] =="yes"){

$name_post = $_POST['contact_name'];
$email_post = $_POST['contact_email'];
$unique_post = rand(487546515116548413561, 156489491961841561654484456216515);
$country_ident = $_POST['country'];
$complete = "complete";
mysql_connect("localhost","user","pass");
mysql_select_db("user");
if(mysql_query("INSERT INTO details (name, email, unique) VALUES('$name_post', '$email_post', '$unique_post' ) ")) 
    {  
    setcookie("first", "complete", time()+3600);
$_SESSION['country'] = $_POST['country'];
    $_SESSION['unique'] = $unique_post;
$_SESSION['email'] = $_POST['contact_email'];
$headerlocation = "1"; 
} 
else 
{
$headerlocation = "2";
}

///blah blah blah rest of it works
?>

 

Hi peeps I ahve pasted the code that is the issue. I have had it working before but as soon as i add the UNIQUE into the mix it throws back mysql error I have set the script to fall back if there is a problem inserting. This is the first time i have seen this message and it was only since I added it to the script. I have tried everything in my knowledge (pretty limited) but still not getting no where.

 

any help would be great

thanks

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.