• 9th, Jun 2010

PHP MySQL Stuff

$conn = mysql_connect($Server,$User,$Password, 3306) or die(mysql_error());
mysql_select_db($Database, $conn ) or die(mysql_error());
$query = sprintf("SELECT * FROM profiles_profiles WHERE UUID='%s'",mysql_real_escape_string($_GET["UUID"]));
$rs = mysql_query($query, $conn);
$row =  mysql_fetch_assoc($rs);
if($row) {
 echo $row["id"];
}

Note: Creating the query with mysql_real_escape_string you will protect your code against SQL Injection Vulnerability.

Tags: , , , , ,

Leave a Reply

*

© 2010 unexpected[it]. All Rights Reserved.