Page 11 of 13

Re: Video#2

Posted: Thu Jun 16, 2011 3:57 pm
by hallsofvallhalla
please post your connect.php or at least line 3

Re: Video#2

Posted: Thu Jun 16, 2011 7:25 pm
by Zorber

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");
 
 ?>

Re: Video#2

Posted: Thu Jun 16, 2011 7:33 pm
by hallsofvallhalla

Code: Select all

$db = mysql_connect(localhost","root","") or die ("Could not connect to db");
missing a "

Code: Select all

$db = mysql_connect("localhost","root","") or die ("Could not connect to db");

Re: Video#2

Posted: Thu Jun 16, 2011 11:06 pm
by Zorber
ah, I see it now , Thanks ;)

Re: Video#2

Posted: Wed Oct 05, 2011 9:15 pm
by joedraco
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.


???

Re: Video#2

Posted: Wed Oct 05, 2011 9:56 pm
by Jackolantern
Please only post a problem to one place. You already asked this question in one of the sticky threads in this forum section.

Re: Browser MMO Video#2

Posted: Sun Aug 05, 2012 8:10 am
by kaitokid89
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

Re: Browser MMO Video#2

Posted: Sun Aug 05, 2012 7:50 pm
by Jackolantern
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?

Re: Browser MMO Video#2

Posted: Sun Aug 05, 2012 8:31 pm
by kaitokid89
Yep I put it in the tutorial folder.

when i run localhost/tutorial/test.php it said "could not select player"

Re: Browser MMO Video#2

Posted: Sun Aug 05, 2012 8:38 pm
by Jackolantern
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.