Jump to content

Whats wrong with this?


andylord

Recommended Posts

<?
$Name = "Initiate Touch of Fire";
$query = SELECT * FROM Runesred WHERE Name='$Name' or die                      ('Error Selecting');
$result = mysql_query($query, $connection)or die                      ('Error Results');;
$Name2 = mysql_result($result,"Name");
$Image = mysql_result($result,"Image");
$Class = mysql_result($result,"Class");
$Level = mysql_result($result,"Level");
$Damage = mysql_result($result,"Damage");
$Effect = mysql_result($result,"Effect");
$DroppedBy = mysql_result($result,"DroppedBy");
$Description = mysql_result($result,"Description");
$Mana = mysql_result($result,"Mana");


echo "<tr><td>$Name2</td><td></td></tr><tr><td>$Image</td><td> </td></tr><tr><td>$Class</td><td> </td></tr><tr><td>$Level</td><td> </td></tr><tr><td> </td><td>$Damage</td></tr><tr><td> </td><td>$Effect</td></tr><tr><td> </td><td>$DroppedBy</td></tr><tr>  <td> </td><td>$Description</td></tr><tr><td> </td><td>$Mana</td></tr></table>";
?>

 

Looking for a while cant find it maybe another couple eyes could ? Before its just all the connection information (works tested)

Link to comment
https://forums.phpfreaks.com/topic/197268-whats-wrong-with-this/
Share on other sites

Oh, and I decided to clean the code up a bit.

<?
$Name = "Initiate Touch of Fire";
$query = "SELECT * FROM `Runesred` WHERE `Name`='$Name';" or die('Error Selecting\n<br />'.mysql_error());
$result = mysql_query($query, $connection)or die("Error Results: \n<br />".mysql_error());
while ($res = mysql_fetch_assoc($result)){
$Name2 = $res['Name'];
$Image = $res['Image'];
$Class = $res['Class'];
$Level = $res['Level'];
$Damage = $res['Damage'];
$Effect = $res['Effect'];
$DroppedBy = $res['DropedBy'];
$Description = $res['Description'];
$Mana = $res['Mana'];
echo "<tr><td>$Name2</td><td></td></tr><tr><td>$Image</td><td> </td></tr><tr><td>$Class</td><td> </td></tr><tr><td>$Level</td><td> </td></tr><tr><td> </td><td>$Damage</td></tr><tr><td> </td><td>$Effect</td></tr><tr><td> </td><td>$DroppedBy</td></tr><tr>  <td> </td><td>$Description</td></tr><tr><td> </td><td>$Mana</td></tr></table>";	
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.