hosseind600 Posted February 19, 2009 Share Posted February 19, 2009 hi i have a form. if user selected private i want the form to be sent to table private else the data should be sent to normals table <?php include ('connection.php') ; $name = $_GET['name']; $r = rand(); $q = $_GET['q'] ; include ("PersianDate.Class.php"); $pd = new PersianDate; date_default_timezone_set('Asia/Tehran'); $pd2 = $pd->Date("y/m/d") ; $p = $_GET['pri'] ; if ($p == 1) { $sql1 = "insert into private (id,name,question,date,code) values (NULL,'$name','$q','$pd2','$r')" ; mysql_query($sql1); } else { $sql3 = "insert into normals (id,name,question,date,code) values (NULL,'$name','$q','$pd2','$r')"; mysql_query($sql3); } ?> where is my problem Quote Link to comment https://forums.phpfreaks.com/topic/145974-a-question-on-ifs/ Share on other sites More sharing options...
Maq Posted February 19, 2009 Share Posted February 19, 2009 Does it always INSERT into normals? Have you echoed out $p? What is the value of it? Where is your link that brings you to this page? Quote Link to comment https://forums.phpfreaks.com/topic/145974-a-question-on-ifs/#findComment-766365 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.