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? Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/ 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. Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281701 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? Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281703 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. Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281708 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? Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281710 Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 What query are we talking about? Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281711 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()); Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281713 Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 Then it should work. Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281717 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 Link to comment https://forums.phpfreaks.com/topic/57028-solved-will-this-work/#findComment-281718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.