Need help with " and ' and concatention

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
katkat
Forum Newbie
Posts: 23
Joined: Tue Mar 03, 2009 9:50 pm

Need help with " and ' and concatention

Post by katkat »

Can anyone help me with this concatenation?

$query = "DELETE FROM runners WHERE firstname.lastname=" . $runnernames && passw=$pw;

- $runnernames has the first and last name in it with no spaces, for example: johndoe
- I am not able to get the passw included correctly in this statement
thanks!!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Need help with " and ' and concatention

Post by Benjamin »

Code: Select all

 
$query = "DELETE
           FROM
             runners
           WHERE
             CONCAT(firstname, lastname) = '" . mysql_real_escape_string($runnernames) . "'
             AND passw = '" . mysql_real_escape_string($pw) . "'";
 
Post Reply