Results 1 to 13 of 13
Dec 20, 2004, 12:37 #1
- Join Date
- Nov 2001
- 0 Post(s)
- 0 Thread(s)
What is the best/correct way to query a database with variables?
Can someone tell me what the best way to query a database is that uses variables? I'm kind of confused about how and where to use ' and " and whether or not to escape the PHP code when loading variables and also with using globals. Here's an example of one of my queries. Can someone make some suggestions as to how to do it "correct"?
$result = mysql_query("SELECT login, pass, id FROM users WHERE login=\"$_POST['login']\"") or die ("Invalid query : Error 3.1");John Saunders