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; } 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. 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 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]' 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... 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
Archived
This topic is now archived and is closed to further replies.