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!
$id = (int)$_GET['trackID'];
mysql_query( "SELECT * FROM antiques WHERE track_ID = '$id'");
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Hi Thanks,
The thing is that it not an int it is going to be some thing like this: 4UkGETIT.
I tried to put it in a variable first and but that variable inside the select query and I am getting the same error.
YoussefSiblini wrote:Hi Thanks,
The thing is that it not an int it is going to be some thing like this: 4UkGETIT.
Then at least use mysql_real_escape_string() on it. But your example showed an INT.
I tried to put it in a variable first and but that variable inside the select query and I am getting the same error.
What error?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
$trackID = $_GET['trackID'];
include 'includes/ALL.php';
$sql_added_Swaps = mysql_query( "SELECT * FROM antiques WHERE track_ID = '$trackID'");
$productCount = mysql_num_rows($sql_added_Swaps);
if ($productCount > 0)
{
while($row = mysql_fetch_array($sql_added_Swaps))
{
$id = $row["id"];
$track_ID = $row["track_ID"];
$producttittle = $row["producttittle"];
$productdescription = $row["productdescription"];
//what is he expecting in return
$dateadded = $row["dateadded"];
echo $email;
}
}
else
{
echo"Didn't work";
}
The error I am getting is: Didn't word , Which I echoed it. It is not picking the variable value which is 4UkGETIT. If I use this value instead it work fine.
Don't worry about the security stuff I want to fix this problem first and I am going to secure it after this.
Youssef
Last edited by YoussefSiblini on Mon Sep 26, 2011 5:22 pm, edited 1 time in total.
Well then $_GET['trackID'] is empty or not set. How do you access this page?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.