MrMe
10-21-2009, 08:50 AM
I am trying to build an inventory list for my website. I attempt to retrieve the information and all i get is "Resource id #4 Resource id #5 Resource id #6 Resource id #7 Resource id #8 Resource id #9 Resource id #10 Resource id #11 Resource id #12 "
<?php
$con = mysql_connect("HOST","USER","PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DB", $con);
$equip = mysql_query("SELECT * FROM TABLE1 WHERE name=$_SESSION['user'];");
$equiped = mysql_fetch_array($equip);
$wep1 = mysql_query("SELECT pic FROM table2 where id='$equiped[wep1]'");
$gloves = mysql_query("SELECT pic FROM table2 where id='$equiped[gloves]'");
$ring1 = mysql_query("SELECT pic FROM table2 where id='$equiped[ring1]'");
$helm = mysql_query("SELECT pic FROM table2 where id='$equiped[helm]'");
$body = mysql_query("SELECT pic FROM table2 where id='$equiped[body]'");
$belt = mysql_query("SELECT pic FROM table2 where id='$equiped[belt]'");
$ring2 = mysql_query("SELECT pic FROM table2 where id='$equiped[ring2]'");
$wep2 = mysql_query("SELECT pic FROM table2 where id='$equiped[wep2]'");
$boots = mysql_query("SELECT pic FROM table2 where id = '$equiped[boots]'");
?>
and the code to display it is,
<html>
<style>
img {
background-color: yellow;
}
</style>
<body><center>
<table border="0" width="50%" cellpadding="0">
<tr>
<td valign="right">
<br><br>
<?php
Print "
<img src=$wep1 width=\"100\" height=\"200\" alt=\"Wep Slot1\"><br><br>
<img src=$gloves width=\"100\" height=\"100\" alt=\"Gloves\">";
?>
</td>
<td valign="top">
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<?php
Print "<img src=$ring1 width=\"50\" height=\"50\" alt=\"R1\"> ";
?>
</td>
<td valign="top">
<?php
Print "<img src=$helm width=\"100\" height=\"100\" alt=\"Helm\"><br><br>
<img src=$body width=\"100\" height=\"200\" alt=\"Body\"><br><br>
<img src=$belt width=\"100\" height=\"50\" alt=\"Belt\">";
?>
</td>
<td valign="top">
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<?php
Print "<img src=$ring2 width=\"50\" height=\"50\" alt=\"R2\">";
?>
</td>
<td valign="top">
<br><br>
<?php
Print "<img src=$wep2 width=\"100\" height=\"200\" alt=\"Wep Slot 2\"><br><br>
<img src=$boots width=\"100\" height=\"100\" alt=\"Boots\">";
?>
</td>
</tr>
</table>
</body>
</html>
All the images are broken and i tryed using
Print "
$wep1
$gloves
$ring1
$helm
$body
$belt
$ring2
$wep2
$boots
";
to display the info and got "Resource id #4 Resource id #5 Resource id #6 Resource id #7 Resource id #8 Resource id #9 Resource id #10 Resource id #11 Resource id #12 "
I really need some help!
<?php
$con = mysql_connect("HOST","USER","PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DB", $con);
$equip = mysql_query("SELECT * FROM TABLE1 WHERE name=$_SESSION['user'];");
$equiped = mysql_fetch_array($equip);
$wep1 = mysql_query("SELECT pic FROM table2 where id='$equiped[wep1]'");
$gloves = mysql_query("SELECT pic FROM table2 where id='$equiped[gloves]'");
$ring1 = mysql_query("SELECT pic FROM table2 where id='$equiped[ring1]'");
$helm = mysql_query("SELECT pic FROM table2 where id='$equiped[helm]'");
$body = mysql_query("SELECT pic FROM table2 where id='$equiped[body]'");
$belt = mysql_query("SELECT pic FROM table2 where id='$equiped[belt]'");
$ring2 = mysql_query("SELECT pic FROM table2 where id='$equiped[ring2]'");
$wep2 = mysql_query("SELECT pic FROM table2 where id='$equiped[wep2]'");
$boots = mysql_query("SELECT pic FROM table2 where id = '$equiped[boots]'");
?>
and the code to display it is,
<html>
<style>
img {
background-color: yellow;
}
</style>
<body><center>
<table border="0" width="50%" cellpadding="0">
<tr>
<td valign="right">
<br><br>
<?php
Print "
<img src=$wep1 width=\"100\" height=\"200\" alt=\"Wep Slot1\"><br><br>
<img src=$gloves width=\"100\" height=\"100\" alt=\"Gloves\">";
?>
</td>
<td valign="top">
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<?php
Print "<img src=$ring1 width=\"50\" height=\"50\" alt=\"R1\"> ";
?>
</td>
<td valign="top">
<?php
Print "<img src=$helm width=\"100\" height=\"100\" alt=\"Helm\"><br><br>
<img src=$body width=\"100\" height=\"200\" alt=\"Body\"><br><br>
<img src=$belt width=\"100\" height=\"50\" alt=\"Belt\">";
?>
</td>
<td valign="top">
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<?php
Print "<img src=$ring2 width=\"50\" height=\"50\" alt=\"R2\">";
?>
</td>
<td valign="top">
<br><br>
<?php
Print "<img src=$wep2 width=\"100\" height=\"200\" alt=\"Wep Slot 2\"><br><br>
<img src=$boots width=\"100\" height=\"100\" alt=\"Boots\">";
?>
</td>
</tr>
</table>
</body>
</html>
All the images are broken and i tryed using
Print "
$wep1
$gloves
$ring1
$helm
$body
$belt
$ring2
$wep2
$boots
";
to display the info and got "Resource id #4 Resource id #5 Resource id #6 Resource id #7 Resource id #8 Resource id #9 Resource id #10 Resource id #11 Resource id #12 "
I really need some help!