On May 2, 2009, at 6:43 PM, Emiliano Boragina wrote:


I am using this:
$sql = "SELECT * FROM table WHERE ID LIKE '%$_GET[id]%' AND title LIKE

But I want exactlu ID, not one part of many possibles Ids in the DB.
How can I do that?

PLEASE tell me your cleaning that input...


And to answer your question:

$id = mysql_real_escape_string ($_GET['id']);
$word = mysql_real_escape_string ($_GET['word']);

$sql = "SELECT * FROM `table` WHERE `ID` = '$id' AND `title` = '$word'";

Read more on MySQL's "LIKE" functionality. Google can help you.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to