ryeman98 Posted June 25, 2007 Share Posted June 25, 2007 <?php if ($_POST['check'] == "yes") { $check = "yes"; } else { $check = "no"; } ?> Will that work when I insert it into a query or no? Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 Can't see why not. Try it and see. Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 Well, the only thing is that I have to make 54 of those so if it doesn't work (I'll check multiple times for errors) then... yeah Will it still work if the the query isn't within the braces? Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 Trust me. If it works for one, it'll work for 54. But before I did that 54 times, I'd wonder if I was coding the 'thing' sensibly. Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 OK. But if the query is outside of the if braces { } will it still get the correct variables? Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 What query are we talking about? Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 // all the if statements here } mysql_query("INSERT INTO table (`stuff`, `stuff`, etc.) VALUES('$variable', '$variable', ect.)") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 Then it should work. Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 Ok, thank you! If I have any problems, I'll come back 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.