Forums

This topic is locked

PHP Horizontal Looper

Posted 31 Dec 2002 01:40:50
1
has voted
31 Dec 2002 01:40:50 Frank tedtofston posted:
I've been trying to get this code to work with the php mx server model and I get the error "Fatal error: Call to a member function on a non-object in /home/sites/site85/web/looper.php on line 44" This is the line with $row_Recordset1->MoveNext();

Here is the code I'm using, it works with the phakt model in mx. Any help on getting this to work would be great.

<?php require_once('Connections/conn_port.php'); ?>
<?php
mysql_select_db($database_conn_port, $conn_port);
$query_Recordset1 = "SELECT * FROM catalogue_display";
$Recordset1 = mysql_query($query_Recordset1, $conn_port) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php
$HLooper1__numRows = -3;
$HLooper1__index = 0;
$totalRows_Recordset1 += $HLooper1__numRows;
?>
<?php
$startrw=0;
$endrw=$HLooper1__index;
$numberColumns=3;
$numrows=-1;
while(($row_Recordset1-- !=0) && (!$row_Recordset1->EOF)) {
$startrw=$endrw + 1;
$endrw = $endrw + $numberColumns;
?>

<html>
<head>
<title>Horizontal Looper</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<table>

<tr>
<?php while (($startrw <= $endrw) && (!$row_Recordset1->EOF)) {
?>
<td valign="top" width="281"> <table width="63%" border="1">
<tr>
<td><?php echo $row_Recordset1['image_title']; ?></td>
</tr>
</table></td>
<?php
$startrw++;
$row_Recordset1->MoveNext();

}
?>
</tr>
<?php }?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>




Edited by - frankster on 31 Dec 2002 01:42:20

Reply to this topic