geroido Posted September 3, 2008 Share Posted September 3, 2008 Hi Can anyone see what the problem might be with this sql. The record is being inserted but the recipientid field is empty. I know that $_SESSION['indwho']." contains a value because I've echoed it. The value is a string and the field is varchar. It remains empty for every record. Any ideas? $insert = mysql_query("INSERT INTO `deliver`.`comments` (`userid` ,`recipientid` ,`comment` ,`date` ,`time` ,`forwho` ,`viewed`) VALUES ('".$_SESSION['userid']."', '".$_SESSION['indwho']."', '".$_SESSION['content']."', '".$date."', '".$time."', 'ind', 'no')") or die("Could not insert data because ".mysql_error()); Quote Link to comment Share on other sites More sharing options...
geroido Posted September 3, 2008 Author Share Posted September 3, 2008 This ones killing me. I even assigned the session variable to a normal variale and it's still not working. The echos are showing that the string is held in the variable but it is still the only field that remains empty in the database after insertion. Help? $_SESSION['indwho'] = $_GET['id']; $type = $_SESSION['indwho']; echo $_SESSION['indwho']; echo $type; $insert = mysql_query("INSERT INTO `deliver`.`comments` (`userid` ,`recipientid` ,`comment` ,`date` ,`time` ,`forwho` ,`viewed`) VALUES ('".$_SESSION['userid']."', '".$type."', '".$_SESSION['content']."', '".$date."', '".$time."', 'ind', 'no')") or die("Could not insert data because ".mysql_error()); Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 3, 2008 Share Posted September 3, 2008 Post an example of what the variable contains. How do you know just that filed is empty? How are you looking to see that it is? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 3, 2008 Share Posted September 3, 2008 Echo the query itself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.