strangermaster Posted May 6, 2008 Share Posted May 6, 2008 Hi ! if i check email and it has no numbers it is ok but if it has it doesnot find user but user exists of course, can you help? This is my function : public function getClientId($find) { if (is_numeric($find)) { $sql = "SELECT idmembre FROM b_membres WHERE idmembre='$find'"; $result = $this->cxn->query($sql); if($result->num_rows == 1) return $find; else return false; } else { $sql = "SELECT idmembre FROM b_membres WHERE email='$find'"; $result = $this->cxn->query($sql); if($result->num_rows == 1) { $row=$result->fetch_assoc(); } return $row['idmembre']; } return false; } Quote Link to comment https://forums.phpfreaks.com/topic/104354-select-doesnot-work-if-argument-in-where-includes-numbers/ Share on other sites More sharing options...
fenway Posted May 6, 2008 Share Posted May 6, 2008 What does "Includes numbers" mean? Echo $sql. Quote Link to comment https://forums.phpfreaks.com/topic/104354-select-doesnot-work-if-argument-in-where-includes-numbers/#findComment-534323 Share on other sites More sharing options...
strangermaster Posted May 6, 2008 Author Share Posted May 6, 2008 sorry : ex [email protected] will not pass throught Quote Link to comment https://forums.phpfreaks.com/topic/104354-select-doesnot-work-if-argument-in-where-includes-numbers/#findComment-534354 Share on other sites More sharing options...
strangermaster Posted May 6, 2008 Author Share Posted May 6, 2008 SELECT idmembre FROM b_membres WHERE email='[email protected]' Quote Link to comment https://forums.phpfreaks.com/topic/104354-select-doesnot-work-if-argument-in-where-includes-numbers/#findComment-534362 Share on other sites More sharing options...
fenway Posted May 6, 2008 Share Posted May 6, 2008 Shouldn't be anything wrong with that at all... Quote Link to comment https://forums.phpfreaks.com/topic/104354-select-doesnot-work-if-argument-in-where-includes-numbers/#findComment-534407 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.