todayme Posted March 6, 2007 Share Posted March 6, 2007 Can someone tell me what I am doing wrong, I am geting no errors but it is not inserting the data, I have tried the variables as they are and like this '$variable' but neither seems to work. <? //set the variables as required $dbhost = "localhost"; $dbuser = "admin_sex"; $dbpass = "sex"; $dbname = "admin_sex"; session_start(); echo $_SESSION['accountsession']; $dbDate = date("d.m.y"); $dbState = $_POST['State']; $dbIndustry = $_POST['Industry']; $dbLocation = $_POST['Location']; $dbContact = $_POST['Contact']; $dbStreet = $_POST['Street']; $dbPostCode = $_POST['PostCode']; $dbPhPrefix = $_POST['PhPrefix']; $dbPhone = $_POST['Phone']; $dbMobile = $_POST['Email']; $dbDescription = $_POST['Description']; $dbErgancy = $_POST['R1']; $dbComType = $_POST['R2']; $dbLinkID = $_POST[LinkID]; $db = mysql_pconnect($dbhost,$dbuser,$dbpass); mysql_select_db($dbname) or die(mysql_error()); $sql="INSERT INTO _Leads (LINKID, Industry, Location, State, Date, Contact, Street, PostCode, PhPrefix, Phone, Mobile, Description, Ergancey, ComType) VALUES ($dbLinkID,$dbIndustry,$dbLocation,$dbState,$dbDate,$dbContact,$dbStreet,$dbPostCode,$dbPhPrefix,$dbPhone,$dbMobile,$dbDescription,$dbErgancey,$dbComType)"; mysql_close($db); ?> Link to comment https://forums.phpfreaks.com/topic/41430-insert-problem-mysql/ Share on other sites More sharing options...
iceman400 Posted March 6, 2007 Share Posted March 6, 2007 lol. ur not gonna believe me, but when i had a problem like that what i had to do 2 fix it was add (') around each of the values like this: .....VALUES('$dbLinkID','$dbIndustry','$dbLocation','$dbState',......)"; Link to comment https://forums.phpfreaks.com/topic/41430-insert-problem-mysql/#findComment-200701 Share on other sites More sharing options...
todayme Posted March 6, 2007 Author Share Posted March 6, 2007 I tried that but it doesnt work either. Anyone else got any ideas. Link to comment https://forums.phpfreaks.com/topic/41430-insert-problem-mysql/#findComment-200704 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.