Ok, here’s my 2 problems. I am making an online game, and in the game players can start up their own business. What the form does is make sure the user has entered at least $75,000 capital, then checks to make sure that the business name doesn’t already exist in the table “companies”, then if all that is correct it inserts their data into the table and takes away the X amount of money that they spent on capital. It also takes away 50 of their strength. Now These are my questions:
1.) I have the code to check if the business name already exists, and it works, but it’s not displaying the error I told it to.
$result = mysql_query($query);
if(!$result)
{
if(mysql_errno() == 1062) // duplicate entry error
{
echo "Company name already exists!";
}
}
2.) Now my main question. I want to do a check to see if the player has at least $75000 and 50 strength. If they do, it continues with entering the data into the table and taking away their money. If they don’t, an error displays.