First of all please forgive me for what must seem such a primitive question, I am very new to development and well we all have to start somewhere!
Apparently my code is open to SQL injection, the thing is I have tested following online SQL Injection tutorials, I have been trying to drop the table sub_category but it doesn't work so I think my code is safe?
This is what I put in the URL:
&scatid=1059' OR DROP TABLE sub_category //
Here is the code:
$scatid = $_GET['scatid'];
mysql_select_db($database_yappee, $yappee);
$query_products = "SELECT * FROM products WHERE sub_category='$scatid' AND active = 'Y' ORDER BY id DESC";
$products = mysql_query($query_products, $yappee) or die(mysql_error());
$row_products = mysql_fetch_assoc($products);
$totalRows_products = mysql_num_rows($products);
Forgive me if this seems a silly question, I am just trying to get my head around things!