I heard that mysql query variables or queries are being depreciated and it's not advisable to use them any more, well I'm trying to update my simple website and I want to add some security features for my forms and my database, I have this query below
mysql_query("UPDATE users SET first_name='$name', last_name='$name2', username='$username' , phone_number='$phone', email='$email', user_level='$user_level', type='$type' WHERE id='$id'")
or die(mysql_error());
or
$row = mysql_fetch_array($result);
What's the best way I can write a query without being attacked?