Jiraiya Posted November 17, 2008 Share Posted November 17, 2008 i want a to have a fighting like system in the game i am making. like in the mysql table there are npc enemys for players to fight against to train there characters. the npc enemys have preset health Skill(what is used to determine strength basically its just subtracting the skill from the enemys health and keep doing that until the one of them dies by having there health reach zero. and when a player kills a npc enemy i want the player to gain a set amount of "skill" points and cash to add to there character profiles. Link to comment https://forums.phpfreaks.com/topic/133008-please-help-with-php-mysql-game-math-functions/ Share on other sites More sharing options...
chronister Posted November 17, 2008 Share Posted November 17, 2008 Don't post the question twice please. It keeps from having all relevant information and responses in the same area. In your other post you asked how to use SELECT, ALTER, and UPDATE Sounds like you need to learn the basics of MySql before you can tackle this project. <?php $result = mysql_query("SELECT * FROM users WHERE username = 'bob'"); $numUsers = mysql_num_rows($result); echo 'there are '. $numUsers.' named bob'; $result = mysql_query("UPDATE users SET city='Miami' WHERE username='bob'"); $affected = mysql_affected_rows(); echo 'Updated '.$affected.' row(s)'; $result = mysql_query("ALTER TABLE userId AUTO_INCREMENT = '0'"; ?> that is the basics of how to use them. Get a book or find an online tutorial and happy learning. Nate Link to comment https://forums.phpfreaks.com/topic/133008-please-help-with-php-mysql-game-math-functions/#findComment-691796 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.