I’m wondering if i can use 2 variables with the same name on the same code and it will still work or i need to give every query a diff name? (I know its a super simple question) 😉
Here is an example:
$sql="DELETE FROM apps WHERE app_id='".$app_id."'";
mysql_query($sql) or die(mysql_error());
$sql="DELETE FROM statistics_apps WHERE app_id='".$app_id."'";
mysql_query($sql) or die(mysql_error());
Do i need to change the second $sql to $sql2?
Thanks!
No. as long as you make sure to execute $sql (version1) before $sql (version2)
There’s no need.
On the other hand if you are doing:
You must safe the
$resultquery handle in different vars, if you do not fetch all rows from query1 before you are start with query2.