blink359 Posted May 4, 2009 Share Posted May 4, 2009 I was wondering what is the code for a mysql query to look in a database to see if it can find in the table 'accounts' where login = $user and password = $pass and if it cant it says invalid username or password thanks Quote Link to comment https://forums.phpfreaks.com/topic/156763-need-php-code-for-a-mysql-query/ Share on other sites More sharing options...
gevans Posted May 4, 2009 Share Posted May 4, 2009 <?php $query = "SELECT `login` FROM `accounts` WHERE login='$login' AND password='$pass'"; I'd recommend looking at some tutorials so you can understand what's going on Quote Link to comment https://forums.phpfreaks.com/topic/156763-need-php-code-for-a-mysql-query/#findComment-825503 Share on other sites More sharing options...
blink359 Posted May 4, 2009 Author Share Posted May 4, 2009 Please can you recommend some i think its selecting the record where the user = $user from the form and $pass = pass Whats the best way to learn PhP at a newbie stage aswell? Quote Link to comment https://forums.phpfreaks.com/topic/156763-need-php-code-for-a-mysql-query/#findComment-825505 Share on other sites More sharing options...
gevans Posted May 4, 2009 Share Posted May 4, 2009 http://www.google.co.uk/search?hl=en&q=php+tutorials&btnG=Google+Search&meta=&aq=f&oq= Quote Link to comment https://forums.phpfreaks.com/topic/156763-need-php-code-for-a-mysql-query/#findComment-825506 Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 Whats the best way to learn PhP at a newbie stage aswell? Through lots of practice and messing around. That's the naked truth. Quote Link to comment https://forums.phpfreaks.com/topic/156763-need-php-code-for-a-mysql-query/#findComment-825620 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.