Re: Browser MMO Video#11
Posted: Fri Aug 16, 2013 6:55 pm
What does your players enemies column show in the DB?
Code: Select all
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 18, 2013 at 04:37 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `zombies!!!`
--
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(21) NOT NULL,
`password` varchar(32) NOT NULL,
`email` varchar(55) NOT NULL,
`level` smallint(3) NOT NULL,
`experience` int(11) NOT NULL,
`money` int(11) NOT NULL,
`enemies` int(3) NOT NULL,
`hpoints` mediumint(7) NOT NULL,
`maxhp` smallint(7) NOT NULL,
`strength` mediumint(7) NOT NULL,
`defense` mediumint(7) NOT NULL,
`endurance` mediumint(7) NOT NULL,
`agility` mediumint(7) NOT NULL,
`intelligence` mediumint(7) NOT NULL,
`charisma` mediumint(7) NOT NULL,
`autorepair` mediumint(7) NOT NULL,
`firebuilding` mediumint(7) NOT NULL,
`construction` mediumint(7) NOT NULL,
`cooking` mediumint(7) NOT NULL,
`electricalengineering` mediumint(7) NOT NULL,
`firstaid` mediumint(7) NOT NULL,
`hunting` mediumint(7) NOT NULL,
`fishing` mediumint(7) NOT NULL,
`handtohandcombat` mediumint(7) NOT NULL,
`lockpicking` mediumint(7) NOT NULL,
`pistol` mediumint(7) NOT NULL,
`shotgun` mediumint(7) NOT NULL,
`submachinegun` mediumint(7) NOT NULL,
`machinegun` mediumint(7) NOT NULL,
`assaultrifle` mediumint(7) NOT NULL,
`sniperrifle` mediumint(7) NOT NULL,
`launcher` mediumint(7) NOT NULL,
`lightarms` mediumint(7) NOT NULL,
`weaponmaintenance` mediumint(7) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `players`
--
INSERT INTO `players` (`id`, `name`, `password`, `email`, `level`, `experience`, `money`, `enemies`, `hpoints`, `maxhp`, `strength`, `defense`, `endurance`, `agility`, `intelligence`, `charisma`, `autorepair`, `firebuilding`, `construction`, `cooking`, `electricalengineering`, `firstaid`, `hunting`, `fishing`, `handtohandcombat`, `lockpicking`, `pistol`, `shotgun`, `submachinegun`, `machinegun`, `assaultrifle`, `sniperrifle`, `launcher`, `lightarms`, `weaponmaintenance`) VALUES
(1, 'player1', '098f6bcd4621d373cade4e832627b4f6', 'player1@indieresource.com', 1, 0, 0, 0, 27, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(2, 'test', '098f6bcd4621d373cade4e832627b4f6', 'test@test.com', 1, 0, 0, 0, 15, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(3, 'bob', '9f9d51bc70ef21ca5c14f307980a29d8', 'imnotreallybob.cum', 1, 0, 0, 0, 15, 15, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(4, 'bob2', '436187b1cb437f7ddb11952542e351a4', 'stillnotbob.org', 1, 0, 0, 2, 11, 11, 6, 7, 4, 6, 3, 7, 4, 1, 1, 5, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Code: Select all
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 18, 2013 at 04:39 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `zombies!!!`
--
-- --------------------------------------------------------
--
-- Table structure for table `enemies`
--
CREATE TABLE IF NOT EXISTS `enemies` (
`id` int(3) NOT NULL AUTO_INCREMENT,
`name` varchar(21) NOT NULL,
`hpoints` mediumint(7) NOT NULL,
`attack` mediumint(7) NOT NULL,
`defense` mediumint(7) NOT NULL,
`level` smallint(3) NOT NULL,
`experience` int(12) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `enemies`
--
INSERT INTO `enemies` (`id`, `name`, `hpoints`, `attack`, `defense`, `level`, `experience`) VALUES
(1, 'zombie', 5, 3, 3, 1, 15),
(2, 'big zombie', 10, 6, 6, 1, 30);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Code: Select all
if ($enemies != 0)
{
$enemiesinfo="SELECT * from enemies where name = '$enemies'";
$enemiesinfo2=mysql_query($enemiesinfo) or die("could not get the enemies you were fighting!");
$enemiesinfo3=mysql_fetch_array($enemiesinfo2);
}
Code: Select all
$enemiesinfo="SELECT * from enemies where id = '$enemies'";