SergeantFlash Posted August 11, 2008 Share Posted August 11, 2008 This is the code I have inside a PHP file (that doesn't work): $query2 = "SELECT * FROM {$table} where name = \'{$pname}\' AND kills = {$pkills} order by emp_id desc LIMIT 0,1"; This is the code I had before (that worked): $query2 = "SELECT * FROM {$table} where kills = {$pkills} order by emp_id desc LIMIT 0,1"; This is for a Flash game I'm making. $pkills is the amount of kills the player got (ex. 456), $pname is the name the player entered (ex. Bob). How can I make it so it searches the mySQL table where kills is equal to $pkills and name is equal to $pname. I can't get it to work. Any help is appreciated, thanks in advance! Link to comment https://forums.phpfreaks.com/topic/119224-problem-with-php-mysql-query/ Share on other sites More sharing options...
trq Posted August 11, 2008 Share Posted August 11, 2008 $query2 = "SELECT * FROM {$table} WHERE name = '{$pname}' AND kills = '{$pkills}' ORDER BY emp_id desc LIMIT 0,1"; Link to comment https://forums.phpfreaks.com/topic/119224-problem-with-php-mysql-query/#findComment-614076 Share on other sites More sharing options...
SergeantFlash Posted August 12, 2008 Author Share Posted August 12, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/119224-problem-with-php-mysql-query/#findComment-614451 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.