ki Posted July 21, 2007 Share Posted July 21, 2007 okay what im trying to do is check is 3 variables posted match 3 variables that are in the same mysql db row <? ob_start(); ?> <? require_once('config.php'); $user = $_GET['u']; $pass = $_GET['p']; $serial = $_GET['s']; $q = mysql_query("SELECT * FROM `usr_db` WHERE `users` = '".$user."' AND `password` = '".$pass."' AND `serial` = '".$serial."'"); $q2 = mysql_fetch_object($q); if(!$user) { die('0'); } if(!$pass) { die('0'); } if(!$serial) { die('0'); } if(!$q2) { die('0'); } else { die('1'); } if(($q2->users == $user) && ($q2->password == $pass) && ($q2->serial == $serial)) { die('1'); } ?> thats my code im using the $_GET function because im using it on a VB6 program, If it fails I want it to return a 0 if it all passes I want it to return a 1, but somethings wrong and I don't know what, help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/61120-confirm-problem/ Share on other sites More sharing options...
metrostars Posted July 21, 2007 Share Posted July 21, 2007 <? ob_start(); ?> <? require_once('config.php'); $user = $_GET['u']; $pass = $_GET['p']; $serial = $_GET['s']; $q = mysql_query("SELECT * FROM `usr_db` WHERE `users` = '".$user."' AND `password` = '".$pass."' AND `serial` = '".$serial."'"); $number = mysql_num_rows($q); if($number == 0) {echo "0";} else {echo "1";} ?> Link to comment https://forums.phpfreaks.com/topic/61120-confirm-problem/#findComment-304158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.