Strange MySQL Issues

lectrod

New Member
So I setup a table using mysql query browser, and now i'm trying to fill it up. But no matter what I do, it says "created account succesfully", but nothing ever gets added to the database!The code I have is below:`\[code\] if($connection) { $out = "<p>Please wait while we process your request.</p>"; mysql_select_db( "accounts", $connection ); // Generate Account Number. $AccountNumber = rand(17000, 904870); // Set Account Values. $GenuineUser = 0; $VerifiedAdvertiser = 0; $DateOfBirth = $_POST["bmoth"] . "/" . $_POST["bday"] . "/" . $_POST["byear"]; // MD5 the Account ID. $AccountID = md5($_POST["AccountID"]); // Create Advertiser Account. mysql_query( "INSERT INTO accounts.advertisers ( 'Account Number', 'Account ID', 'First Name', 'Last Name', 'Date Of Birth', 'Email Address', 'Phone Number', 'Street Address', 'City', 'Zip Code', 'State', 'Country', 'Genuine User', 'Verified Advertiser') VALUES ( '".$AccountNumber."', '".$_POST["AccountID"]."', '".$_POST["FirstName"]."', '".$_POST["LastName"]."', '".$DateOfBirth."', '".$_POST["EmailAddress"]."', '".$_POST["PhoneNumber"]."', '".$_POST["StreetAddress"]."', '".$_POST["City"]."', '".$_POST["ZipCode"]."', '".$_POST["State"]."', '".$_POST["Country"]."', '".$GenuineUser."', '".$VerifiedAdvertiser."') "); // Setup Advertisement Table. // Assume account created successfully. $out = "<p>Advertiser Account created.</p>"; } else { die('Oh, @#%#!: ' . mysql_error()); } mysql_close($connection); } else { // else, display form. } ?>\[/code\]`Could somebody kindly help me sort this out, please? I'd appreciate any help at all.Thank youupdateSo, I've managed to figure out what was going to, thanks to all your advice :) As it turns out, it wasn't working because I was using spaces inbetween the Column Names (i.e. Account ID should be AccountID). So I just removed spaces from the table columns, and also from the php code.Thanks all for your help!
 
Back
Top