So basically it is like a PHP game, where you have garage and when you buy cars they go to that garage and there is a list of them in there, also there is a button with url http://localhost/garage?active=58
(58 being a car ID.) this button switches car and makes it active, you can race using that car with other people. HOWEVER, when you add a weird symbol to the url (ex.:active=58@) , it deactivates all cars, because php code stuck at:
Here, it does not recognise the car id and stops here:
$setinactive = mysql_query("UPDATE user_cars SET active='No' WHERE userid='$userid' and carid='$activenow'");
When without symbol, it ordinary proceeds to this line and sets choosen id car active:
$setactive = mysql_query("UPDATE user_cars SET active='Yes' WHERE userid='$userid' and carid='$carid'");
}
I know its bad coding, but is there any simple fix to this?