PHP Code:
<?php
include("/home/stage/public_html/css/inc/theaterconn.php");
$sql = "SELECT id,filmid,name FROM theater WHERE status='2' LIMIT 2 ORDER BY id";
$result = mysql_query( $sql ) or die('mysql_error()' . 'Error: ' . mysql_errno() );
$row = mysql_fetch_assoc($result);
$num = mysql_num_rows($result);
$id = $row['id'];
$filmid = $row['filmid'];
$name = $row['name'];
?>
<table>
<tr>
<td>
<form action="theater.php" method="get">
<input type="hidden" name="id" value ="<? echo $id ?>">
<input type="image" src="http://images.stage6.com/video_images/<? echo $filmid ?>t.jpg" value="Submit" alt="Go to Theater">
<br />
<center><? echo $name ?></center>
<tr>
<td>
<input type="hidden" name="id" value ="<? echo $id ?>">
<input type="image" src="http://images.stage6.com/video_images/<? echo $filmid ?>t.jpg" value="Submit" alt="Go to Theater">
<br />
<center><? echo $name ?></center>
</form>
</tr>
</table>
Basically... I need it to behave much like that of comments. It needs to show the data in a table listed by the ID number, displaying only those that meet the criteria of the SQL database, and I want it to display 30 of them.
EDIT: (if I take out the LIMIT 2, then it shows TWO of the same image w/ the same database data. Instead of retrieving the other row's data and putting it in there...)
After trying something else:
PHP Code:
<?php
include("/home/stage/public_html/css/inc/theaterconn.php");
$sql = "SELECT id,filmid,name FROM theater WHERE status='2' ORDER BY id";
$result = mysql_query( $sql ) or die('mysql_error()' . 'Error: ' . mysql_errno() );
while($row = mysql_fetch_array($result));
$id = $row['id'];
$filmid = $row['filmid'];
$name = $row['name'];
{
echo "<table>";
echo "<tr>";
echo "<td>";
echo "<form action='theater.php' method='get'>";
echo "<input type='hidden' name='id' value=";
echo $id . ">";
echo "<input type='image' src='http://images.stage6.com/video_images/";
echo $filmid . "t.jpg' value='Submit' alt='Go to Theater'>";
echo "<center>";
echo $name . "</center>";
echo "</form>";
echo "</tr>";
echo "</table>";
}
?>
It kept some things, but some things didn't work, experimenting w/ that to see what I get... >.>
(It seems when I do this, it doesn't display the image =/.)