Page 3 of 13
Re: Video#2
Posted: Thu Jul 09, 2009 11:48 pm
by hallsofvallhalla
hey thanks for helping him..
Re: Video#2
Posted: Thu Jul 09, 2009 11:49 pm
by mrmajic
its a community effort
Re: Video#2
Posted: Sun Jul 12, 2009 7:20 am
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.
Re: Video#2
Posted: Sun Jul 12, 2009 2:12 pm
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.
Re: Video#2
Posted: Sun Jul 12, 2009 5:41 pm
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.
Re: Video#2
Posted: Sun Jul 12, 2009 6:05 pm
by Sakar
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
Posted: Sun Jul 12, 2009 7:03 pm
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.

Re: Video#2
Posted: Sun Jul 12, 2009 9:27 pm
by hallsofvallhalla
yes it is case sensitive, you need to change your variables o match mysql tables, so capitalize Email, and Name
Re: Video#2
Posted: Mon Jul 13, 2009 3:32 am
by adam4hand
Awesome. Works great now! Thanks a lot.
Re: Video#2
Posted: Tue Jul 14, 2009 7:55 am
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