Jump to content

Problem with PHP mySQL query


SergeantFlash

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.