Browser MMO Video#2
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#2
please post your connect.php or at least line 3
Re: Video#2
Code: Select all
<?php
$db = mysql_connect(localhost","root","") or die ("Could not connect to db");
if(!$db)
die("no db");
if(!mysql_select_db("Tutorial",$db))
die("No Database Selected");
?>
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#2
Code: Select all
$db = mysql_connect(localhost","root","") or die ("Could not connect to db");
Code: Select all
$db = mysql_connect("localhost","root","") or die ("Could not connect to db");
Re: Video#2
why do i get this message when i try to go to phpMyAdmin: ?
Forbidden
You don't have permission to access /phpmyadmin/ on this server.
???
Forbidden
You don't have permission to access /phpmyadmin/ on this server.
???
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#2
Please only post a problem to one place. You already asked this question in one of the sticky threads in this forum section.
The indelible lord of tl;dr
-
- Posts: 3
- Joined: Sun Aug 05, 2012 8:00 am
Re: Browser MMO Video#2
hi i'd like to say thanks for making this guide.
and i just recently tried it but i get stuck in the part where i should put http://localhost/tutorial/test.php
i got could not select player.
here is my code for connect.php
<?php
$db = mysql_connect ("localhost","root","130589") or die ("ga konek ke db");
if(!$db)
die("dbnya ilang");
if(!mysql_select_db("tutorial",$db))
die("no database selected");
?>
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'];
?>
another info
Field = data
ID = 1
Name = player1
Email = player1@indieresource.com
and i just recently tried it but i get stuck in the part where i should put http://localhost/tutorial/test.php
i got could not select player.
here is my code for connect.php
<?php
$db = mysql_connect ("localhost","root","130589") or die ("ga konek ke db");
if(!$db)
die("dbnya ilang");
if(!mysql_select_db("tutorial",$db))
die("no database selected");
?>
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'];
?>
another info
Field = data
ID = 1
Name = player1
Email = player1@indieresource.com
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Browser MMO Video#2
They would both need to be in the "tutorial" folder from how they are currently set up. What is happening when you try to run test.php? Are you getting an error?
The indelible lord of tl;dr
-
- Posts: 3
- Joined: Sun Aug 05, 2012 8:00 am
Re: Browser MMO Video#2
Yep I put it in the tutorial folder.
when i run localhost/tutorial/test.php it said "could not select player"
when i run localhost/tutorial/test.php it said "could not select player"
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Browser MMO Video#2
That error means that you are connecting to MySQL, but the query is failing. Check the SQL query, and make sure it matches all table and column names exactly in your database. Right now it is assuming you have a record in a table called "players" with a "Name" of "player1". Check in phpMyAdmin to make sure that is all true.
The indelible lord of tl;dr