i have tried to google what im trying to do but there ent no info any were ( i love googeling )
i am trying to make my sql pick a random result from the table pokemon were map = 1
the problem is it is showing all the results and not just a random 1
here's my script
<?php
$con = mysql_connect("localhost","_","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("_", $con);
$result = mysql_query("SELECT * FROM pokemon
WHERE pokemon_map='1'");
while($row = mysql_fetch_array($result))
{
echo $row['pokemon_name'] . " " . $row['pokemon_type'];
echo "<br />";
}
mysql_close($con);
?>
<img src="http://<?php echo $result['pokemon_pic'] ?>" width="90" height="80" />
another problem has well it ent showing the image ether
any ideas how i can make it pick a random result and get the image showing
This post has been edited by nick1200: 20 March 2010 - 04:58 AM

New Topic/Question
Reply



MultiQuote





|