Jake Posted February 20, 2007 Posted February 20, 2007 Here's what i have. I know that it's the INSERT function that's not working because i have separately printed the values i wish to insert, and they print correctly, so i think it may be my arrangement of the insert. $warfirm=mysql_query("SELECT * FROM firms WHERE fID={$_GET['WID']}",$c); $wf=mysql_fetch_array($warfirm); $myfirm=mysql_query("SELECT * FROM firms WHERE fID={$_GET['ID']}",$c); $mf=mysql_fetch_array($myfirm); mysql_query('INSERT INTO `firmwars` (`f1id`, `f1name`, `f2id`, `f2name`, `wardays`) VALUES ('{$mf['fID']}', '{$mf['fNAME']}', '{$wf['fID']}', '{$wf['fNAME']}', '0'),$c); I've tried endless variations of this code, but to no success, please help Quote
UCC Posted February 20, 2007 Posted February 20, 2007 Re: Gang War --- Help Needed I dont know what error your getting but..... Maybe try removing the ` marks around numerical data fields in your VALUES section. I dont write my queries like you do, but that's my guess. Quote
Jake Posted February 21, 2007 Author Posted February 21, 2007 Re: Gang War --- Help Needed That error there gives unexpected {. But other than that, no errors, its just not inserting it. Quote
UCC Posted February 21, 2007 Posted February 21, 2007 Re: Gang War --- Help Needed It looks like you may be missing an end ' after the '0') If that doesn't work, try this code. I'm not making any promises but it's a thought. Again, you use a different query than I do. mysql_query("INSERT INTO firmwars (f1id, f1name, f2id, f2name, wardays) VALUES ({$mf['fID']}, '{$mf['fNAME']}', {$wf['fID']}, '{$wf['fNAME']}', 0)",$c); Quote
Decepti0n Posted February 21, 2007 Posted February 21, 2007 Re: Gang War --- Help Needed add or die(mysql_error()); to the end of all your queries then it'll at least show the SQL error Quote
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.