Browser MMO Video #5
Re: Video#5
is there anywhere to just check i have got the authenticate.php code right.
as i get a parse error come up .
as i get a parse error come up .
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
you can also post your code here, but parse errors are usually missing } or sometimes a missing ; but it will give you the line number.
-
- Posts: 7
- Joined: Mon Jul 06, 2009 9:40 pm
Re: Video#5
i get parse error for line 7 wats wrong with it i have checked a lot.
$player=$_POST['player'];
pls help me =)
$player=$_POST['player'];
pls help me =)
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
show us more of the code
Re: Video#5
There is nothing inherently wrong with that line. Can you give us the rest of your code please?
-
- Posts: 7
- Joined: Mon Jul 06, 2009 9:40 pm
Re: Video#5
i fixed that problem, but i hav a similar problem-
$creature=$_GET['creature'];
$randid=$_GET['randid'];
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!"
playerinfo3=mysql_fetch_array($playerinfo2);
$playerid = $playerinfo3['id']; <---i get notice undifined index:id
$iteminfo="SELECT * from store where randid='$randid'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
$name = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
$randid2 = rand(1000,999999999);
$creature=$_GET['creature'];
$randid=$_GET['randid'];
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!"
playerinfo3=mysql_fetch_array($playerinfo2);
$playerid = $playerinfo3['id']; <---i get notice undifined index:id
$iteminfo="SELECT * from store where randid='$randid'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
$name = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
$randid2 = rand(1000,999999999);
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
the problem is the line above
you are missing
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
Code: Select all
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!"
playerinfo3=mysql_fetch_array($playerinfo2);
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
-
- Posts: 7
- Joined: Mon Jul 06, 2009 9:40 pm
Re: Video#5
i did that andi still get-Notice: Undefined index: id in C:\wamp\www\tutorial\useitem.php on line 21
heres part the code again
$creature=$_GET['creature'];
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$playerid=$playerinfo3['id'];
$counter = 0;
echo "<small>";
heres part the code again
$creature=$_GET['creature'];
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$playerid=$playerinfo3['id'];
$counter = 0;
echo "<small>";
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
give us the whole code so we can see what is line 21