Character Issues [resolved]
Posted: Thu Aug 22, 2013 7:44 am
Hey all! 
I have followed some of the code for the battle information on fighting the creatures. Based upon the theme of my game, I have changed the creatures to characters. I have the same setup in the database for the characters with the same fields. I have went over and over and over, the code for the creatures, and I cannot get it working. Below is my code... any help would be gracious. Driving me nuts it is
This is the error code I get:
*EDITED* Go figure... After I post here, I see that I have SELECT all spelled SECLECT all LMAO. Oh well. Code might help someone else LMAO. Thanks
I have followed some of the code for the battle information on fighting the creatures. Based upon the theme of my game, I have changed the creatures to characters. I have the same setup in the database for the characters with the same fields. I have went over and over and over, the code for the creatures, and I cannot get it working. Below is my code... any help would be gracious. Driving me nuts it is
Code: Select all
<?php
session_start();
include("header.php");
if(!isset($_SESSION['uid'])){
echo "You must be logged in to view this page!";
}else{
if (isset($_GET['characters']))
{
$characters=$_GET['characters'];
$charactersinfo = "SELECT * from characters where name = '$characters'";
$charactersinfo2 = mysql_query($charactersinfo) or die ("Could not get the character you were fighting!");
$charactersinfo3 = mysql_fetch_array($charactersinfo2);
} else {
$charactersinfo = "SECLECT * from characters order by rand() limit 1";
$charactersinfo2 = mysql_query($charactersinfo) or die ("Could not get a character!");
$charactersinfo3 = mysql_fetch_array($charactersinfo2);
}
$characters = $charactersinfo3['name'];
$charactershp = $charactersinfo3['hpoints'];
$charactersattack = $charactersinfo3['attack'];
$charactersdefense = $charactersinfo3['defense'];
echo $stats['hpoints'];
echo $stats['attack'];
echo $stats['defense'];
echo "<u> " . $charactersinfo3['name'] . "</u><br>";
echo "Hit Points = " . $charactershp . "<br>";
echo "Attack = " . $charactersattack . "<br>";
echo "Defense = " . $charactersdefense . "<br>";
echo "<a href='attack.php?characters=$characters'>Attack!";
output("You have visited this page incorrectly!");
}
include("footer.php");
?>Code: Select all
$charactersinfo2 = mysql_query($charactersinfo) or die ("Could not get a character!");