Browser MMO Video#2
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#2
hey thanks for helping him..
Re: Video#2
its a community effort
Re: Video#2
Hello. First off, I just want to say that i think this is a great thing your doing here. With the tutorial and all. I have been wanting to learn PHP for awhile but was having trouble getting my foot in the door. This is really helping out a lot.
As you can tell, I have made it to the second video and am running into a problem.
After creating both the connect.php and test.php and then testing out the test.php in firefox, the page looks like the following:
Notice: Undefined index: email in F:\wamp\www\Tutorial\Test.php on line 8
Player1's email is
Notice: Undefined index: id in F:\wamp\www\Tutorial\Test.php on line 9
Player1's id is
My code matches what you have in the video and what halls posted exactly. I went back and checked my database and it also looks fine. What am I doing wrong? Thanks.
As you can tell, I have made it to the second video and am running into a problem.
After creating both the connect.php and test.php and then testing out the test.php in firefox, the page looks like the following:
Notice: Undefined index: email in F:\wamp\www\Tutorial\Test.php on line 8
Player1's email is
Notice: Undefined index: id in F:\wamp\www\Tutorial\Test.php on line 9
Player1's id is
My code matches what you have in the video and what halls posted exactly. I went back and checked my database and it also looks fine. What am I doing wrong? Thanks.
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#2
please post your test.php here for us to look at, and if possible got to phpmyadmin and go to export, then at the bottom is says export as file.
open that file with wordpad and paste the contents here...
it could be a silly little error and you might want to watch through the other videos and start on the actual game instead.
open that file with wordpad and paste the contents here...
it could be a silly little error and you might want to watch through the other videos and start on the actual game instead.
Re: Video#2
Here is the Test.php:
<?php
include 'connect.php';
$playerinfo ="select * from players where name = 'player1'";
$playerinfo2 = mysql_query($playerinfo) or die ("Could not Select Players");
$playerinfo3 = mysql_fetch_array($playerinfo2);
echo "Player1's email is " . $playerinfo3['email'];
echo "<br>Player1's id is " . $playerinfo3['id'];
?>
Here is the export from phpMyAdmin:
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 12, 2009 at 05:41 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `tutorial`
--
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`ID` int(9) NOT NULL,
`Name` varchar(21) NOT NULL,
`Email` varchar(55) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `players`
--
INSERT INTO `players` (`ID`, `Name`, `Email`) VALUES
(1, 'player1', 'player1@indieresource.com');
Thanks a lot.
<?php
include 'connect.php';
$playerinfo ="select * from players where name = 'player1'";
$playerinfo2 = mysql_query($playerinfo) or die ("Could not Select Players");
$playerinfo3 = mysql_fetch_array($playerinfo2);
echo "Player1's email is " . $playerinfo3['email'];
echo "<br>Player1's id is " . $playerinfo3['id'];
?>
Here is the export from phpMyAdmin:
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 12, 2009 at 05:41 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `tutorial`
--
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`ID` int(9) NOT NULL,
`Name` varchar(21) NOT NULL,
`Email` varchar(55) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `players`
--
INSERT INTO `players` (`ID`, `Name`, `Email`) VALUES
(1, 'player1', 'player1@indieresource.com');
Thanks a lot.
Re: Video#2
test.php looks fine. I'm not sure if PHP's case-sensitive, but if it is that might be a problem.
Re: Video#2
Yea. I tried adjusting everything i thought might be an issue caused from PHP being case sensitive. But the way it looks i dont think it is case-sensitive. But im a noob. 

- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#2
yes it is case sensitive, you need to change your variables o match mysql tables, so capitalize Email, and Name
Re: Video#2
Awesome. Works great now! Thanks a lot.
Re: Video#2
i can watch the tuts on you tube normally though those videos i click play then it comes up a black screen and does nothing can someone tell me why? i really want to make this MMO