Browser MMO Video #7

Location of the Videos
zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: Video#7

Post by zolacat999 »

just me being thick can you elaborate on 'indexed' not fully sure what it means
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#7

Post by OldRod »

When you're looking at your table in phpMyAdmin, down towards the bottom of the screen you should see "+details"

Click the "+" to open that up and you'll see more info about the table, including indexes. If there is an index on your table, remove it and see if that fixes the problem.
zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: Video#7

Post by zolacat999 »

ah got it thanks :)
roah235
Posts: 8
Joined: Tue Dec 29, 2009 10:22 pm

Re: Video#7

Post by roah235 »

hello all

I seem to be having some trouble getting my potions to actually heal me.
Ive examined the php and my database for errors to no avail.

can anyone help?
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#7

Post by hallsofvallhalla »

lets see your code.
roah235
Posts: 8
Joined: Tue Dec 29, 2009 10:22 pm

Re: Video#7

Post by roah235 »

here it is

Code: Select all

<?php

include_once 'connect.php';
session_start();

if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
  exit;
}

$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>";
      print "<center>";
      print "<table border='0' width='70%' cellspacing='20'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='75%'>";
      $invinfo="SELECT * from inventory where id='$playerid'";
      $invinfo2=mysql_query($invinfo) or die("could not select player inventory");
      print "<table border='1' bordercolor='white' bgcolor='#ffffff'>";
      print "<tr><td>Name<font color='ffffff'>________________</font></td><td>Stat<font color='ffffff'>______</td><td>Stat Add<font color='ffffff'>______</td><td>Type<font color='ffffff'>______</td><td><font color='ffffff'>________________</td></tr>";
      while($invinfo3=mysql_fetch_array($invinfo2))
      {
      print "<tr><td>$invinfo3[name]</td><td>$invinfo3[stats]</td><td>$invinfo3[statadd]</td><td>$invinfo3[type]</td><td><A href='battle.php?randid=$invinfo3[randid]&creature=$creature'>Use Item</td></tr>";
       $counter = 1;

      }

      print "</table>";
      print "</td></tr></table>";
      print "</center>";
       echo "</small>";

      if ($counter == 0)
      {
            echo "<center>You have Nothing in your inventory!<br>";
            echo "<a href='battle.php?creature=$creature'>Go Back</center>";
            exit;
      }

    echo "<center><a href='battle.php?creature=$creature'>NeverMind</center>";
   
    ?>
roah235
Posts: 8
Joined: Tue Dec 29, 2009 10:22 pm

Re: Video#7

Post by roah235 »

thats "useitem.php" btw
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Re: Video#7

Post by ZeroComp »

heres mine if that helps any

Code: Select all

<?php

include_once 'connect.php';
 session_start();
 include_once 'logo.php';
 ?>
 <link href="style.css" rel="stylesheet" type="text/css" />
 <?php

if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
  exit;
}



$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
include_once 'statpanel.php';
$playerid = $playerinfo3['id'];

$counter = 0;
 echo "<small>";
      print "<center>";
      print "<table border='0' width='70%' cellspacing='20'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='75%'>";
      $invinfo="SELECT * from inventory where id='$playerid'";
      $invinfo2=mysql_query($invinfo) or die("could not select player inventory");
      print "<table border='1' bordercolor='Black' bgcolor='#ffffff'>";
      print "<tr><td>Name<font color='ffffff'>________________</font></td><td>Stat<font color='ffffff'>______</td><td>Stat Add<font color='ffffff'>______</td><td>Type<font color='ffffff'>______</td><td><font color='ffffff'>________________</td></tr>";
      while($invinfo3=mysql_fetch_array($invinfo2))
      {
      print "<tr><td>$invinfo3[name]</td><td>$invinfo3[stats]</td><td>$invinfo3[statadd]</td><td>$invinfo3[type]</td><td><A href='battle.php?randid=$invinfo3[randid]'>Use Item</td></tr>";
       $counter = 1;

      }

      print "</table>";
      print "</td></tr></table>";
      print "</center>";
		 echo "</small>";

      if ($counter == 0)
      {
            echo "<center>You have Nothing in your inventory!<br>";
            echo "<a href='battle.php'>Go Back</center>";
            exit;
      }

    ?>
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#7

Post by hallsofvallhalla »

its actually battle.php that i need to see.
roah235
Posts: 8
Joined: Tue Dec 29, 2009 10:22 pm

Re: Video#7

Post by roah235 »

oh fail.... item use is handled in battle.php. That helps :D

i found my issue. Thanks
Post Reply

Return to “Older Browser MMO Videos”