aFk Posted February 24, 2009 Report Share Posted February 24, 2009 (edited) Since nobody could answer my first question, probably cause it was impossible to explain fine lol. Yes, I'm very new to PHP but perhaps someone could explain why this isn't inserting into my table on msql. <?php $wins=$_POST['winner']; $loss=$_POST['loser']; $draw=('1'); $streak=$_POST['']; $team1=$_POST['select2']; $team2=$_POST['select']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("stats", $con); if ($wins==$loss){ mysql_query("INSERT INTO standings (draw,) VALUES (".$draw.")");} else echo "false!"; mysql_close($con); ?> I have a form with the name "winner" && "loser" Basically I have it comparing fine, if the score is a draw I want the variable $wins && $loss to insert into table the result from $draw variable. But it's not inserting into data base? please someone explain! thanks Edited February 24, 2009 by aFk Quote Link to comment Share on other sites More sharing options...
aFk Posted February 24, 2009 Author Report Share Posted February 24, 2009 (edited) sigh never mind thanks for the help correct syntax was mysql_query("INSERT INTO `standings` (wins) VALUES ('".$wins."')"); mysql_query("INSERT INTO `standings` (draw) VALUES ('".$draw."')"); I don't understand why nobody could answer this question. Edited February 24, 2009 by aFk Quote Link to comment Share on other sites More sharing options...
Andrea Posted February 24, 2009 Report Share Posted February 24, 2009 You posted this question around midnight US time - many of us were asleep - and not every person on this forum knows PHP (I don't). So be a little patient here. Quote Link to comment Share on other sites More sharing options...
aFk Posted February 25, 2009 Author Report Share Posted February 25, 2009 (edited) Hard to be patient when stuck on a syntax. I mean, my other post has be patiently waiting for a reply for 2 days. It's ok I joined a different forum no biggie. Thanks Edited February 25, 2009 by aFk 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.
Note: Your post will require moderator approval before it will be visible.