Id_42 Posted July 24, 2007 Share Posted July 24, 2007 I'm having what seems to me to be a really strange problem. The following query (with a bit of extra code for context) doesn't seem to work at all: $savemap = serialize($_SESSION['desertmap']); mysql_query("INSERT INTO deserttable (OwnerID, Positions) VALUES ({$_SESSION['PlayerID']}, {$savemap});"); $_SESSION['desertmap'] works fine, and $savemap works fine when echoed (giving me things like "a:16:{i:11;i:1;i:12;i:2;i:13;i:1;i:14;i:4;i:21;i:1;i:22;i:1;i:23;i:2;i:24;i:3;i:31;i:2;i:32;i:2;i:33;i:1;i:34;i:1;i:41;i:2;i:42;i:2;i:43;i:9;i:44;i:1;}", as I would expect it to). I just can't get any query that attempts to store $savemap to work correctly - and what's strange is that PHP isn't delivering any error messages of any kind, it's just failing to work. And I do know that that part of the script is working, as I've thrown in a couple of throwaway messages before and after the query that are displaying as they should be, so it's not like there's some sort of faulty if statement that's preventing it from getting triggered at all. And it's not, I think, that the table's defined wrong, as I've tried putting $savemap into a different table entirely, in a field that I know is set as CHAR (255), and it doesn't work any better there. Any thoughts? Helpplz? Banging my head against this isn't getting me anywhere at this point. Thanks! Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 24, 2007 Share Posted July 24, 2007 dude is there a connection in your db and is there any error pls post if any or try using the concatenator instead of {} Quote Link to comment Share on other sites More sharing options...
Id_42 Posted July 24, 2007 Author Share Posted July 24, 2007 Yes, I'm connected to my database, and no, it's not giving me any error messages at all - it's just not working. Wait - no, now it is, having grabbed a random snippet of code from a part of the project someone else did. I'm not sure exactly what the deal is, but, uh, problem solved. 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.