hAhA
asked on
my sql question, should be easy
hey I have another question, I cannot figure out what's wrong with my php, here is the php, and the link where I am trying to use it:
--------
<table width="100%" border="1">
<tr><th>ID<th>Image<th>Nam e<th>Base HP<th>Base MP<th>Active
<?
include 'db.php';
function x_dir($param)
{
$dir = opendir($param);
$files = array();
while ($ff=readdir($dir))
{
if ($ff!=".." && $ff!=".")
{
$files[count($files)]=$ff;
}
}
return $files;
}
$result = x_dir("enem/");
for ($i=0;$i<count($result);$i ++) {
echo '<tr><th>'.$i.'<th width="50"><img src="enem/'.$result[$i].'" ><th>';
$products=array();
mysql_select_db($database_ name,$conn ection) or die ("bad select DB ".mysql_error());
$query="select * from usersenem;";
$result=mysql_query($query ,$connecti on) or die ("bad query $query. ".mysql_error());
while ($res=mysql_fetch_array($r esult)) {
$enem_name=$res["enem_name "];
$enem_hp=$res["enem_hp"];
$enem_mp=$res["enem_mp"];
$ID=$res["id"];
}
echo $enem_name.'<th>'.$enem_hp .'<th>'.$e nem_mp;
}
?>
</table>
--------
http://phpwarz.cscomps.com/admin.php
thanks in advance, im still trying to figure out these mysql tables : \
--------
<table width="100%" border="1">
<tr><th>ID<th>Image<th>Nam
<?
include 'db.php';
function x_dir($param)
{
$dir = opendir($param);
$files = array();
while ($ff=readdir($dir))
{
if ($ff!=".." && $ff!=".")
{
$files[count($files)]=$ff;
}
}
return $files;
}
$result = x_dir("enem/");
for ($i=0;$i<count($result);$i
echo '<tr><th>'.$i.'<th width="50"><img src="enem/'.$result[$i].'"
$products=array();
mysql_select_db($database_
$query="select * from usersenem;";
$result=mysql_query($query
while ($res=mysql_fetch_array($r
$enem_name=$res["enem_name
$enem_hp=$res["enem_hp"];
$enem_mp=$res["enem_mp"];
$ID=$res["id"];
}
echo $enem_name.'<th>'.$enem_hp
}
?>
</table>
--------
http://phpwarz.cscomps.com/admin.php
thanks in advance, im still trying to figure out these mysql tables : \
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks, both of you, but I figured out what the hell I was doing and got it to work before you responded : )
try using
this
while ($res=mysql_fetch_assoc($r
instead of this
while ($res=mysql_fetch_array($r
thjen you can access the records the way you are trying