Browser MMO Video#2

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#2

Post by hallsofvallhalla »

hey thanks for helping him..
mrmajic
Posts: 117
Joined: Sat Jun 27, 2009 9:37 am

Re: Video#2

Post by mrmajic »

its a community effort
Mr Majic...

Current Project: http://www.deltarealm.net
feedback welcome.
adam4hand
Posts: 4
Joined: Sun Jul 12, 2009 7:10 am

Re: Video#2

Post by adam4hand »

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.
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#2

Post by hallsofvallhalla »

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.
adam4hand
Posts: 4
Joined: Sun Jul 12, 2009 7:10 am

Re: Video#2

Post by adam4hand »

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.
User avatar
Sakar
Posts: 520
Joined: Thu Apr 23, 2009 2:59 am

Re: Video#2

Post by Sakar »

test.php looks fine. I'm not sure if PHP's case-sensitive, but if it is that might be a problem.
adam4hand
Posts: 4
Joined: Sun Jul 12, 2009 7:10 am

Re: Video#2

Post by adam4hand »

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. :lol:
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#2

Post by hallsofvallhalla »

yes it is case sensitive, you need to change your variables o match mysql tables, so capitalize Email, and Name
adam4hand
Posts: 4
Joined: Sun Jul 12, 2009 7:10 am

Re: Video#2

Post by adam4hand »

Awesome. Works great now! Thanks a lot.
666ryster
Posts: 4
Joined: Mon Jul 13, 2009 5:42 am

Re: Video#2

Post by 666ryster »

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
Post Reply

Return to “Older Browser MMO Videos”