PDA

View Full Version : Horizontal Repeat Region - is it possible?


parabol
02-27-2007, 09:40 PM
Hi,

I already have a Bi-Dimensional Repeater, but Im hoping to display recordsets along a line (separated by comma) instead of number of columns.

Example:

Members In Database:
jimmy, graham, peachy, michael, michaelb, hench, danny boy,

Instead of:
Members In Database:
jimmy, graham, peachy,
michael, michaelb, hench,
danny boy

I hope you can help-
Cheers
:-)

davidj
02-27-2007, 09:43 PM
yes

just get rid of your repeater (which sounds like its a third party snippet or extension)

post the code

parabol
02-27-2007, 09:51 PM
I have removed Bi-Dimensional Repeat:


<?php
require_once('Connections/Farout.php');

mysql_select_db($database_Farout, $Farout);
$query_Recordset1 = "SELECT * FROM phpbb_users";
$Recordset1 = mysql_query($query_Recordset1, $Farout) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32">Member List</td>
</tr>
<tr>
<td height="87"><?php echo $row_Recordset1['username']; ?>,</td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

davidj
02-27-2007, 10:02 PM
<?php
require_once('Connections/Farout.php');

$link = @mysql_connect('localhost', $username, $password);
$db = mysql_select_db($database, $link);
$query = "SELECT * FROM phpbb_users";
$result = @mysql_query($query);
$row = mysql_fetch_array($result);

?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32">Member List</td>
</tr>
<tr>
<td height="87">

<?php
do {

echo $row_Recordset1['username'].",";

}while ($row = mysql_fetch_array($result));

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

parabol
02-27-2007, 10:17 PM
Hi Davidj

Thanks for your quick response, I can see what you're doing there.
Alhough Im getting this:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/home/thefi1/www/htdocs/repeater.php on line 7
Member List,
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/home/thefi1/www/htdocs/repeater.php on line 28

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/home/thefi1/www/htdocs/repeater.php on line 37

davidj
02-27-2007, 10:20 PM
is the result coming back?

if so just supress the warning by adding an @

$row = @mysql_fetch_array($result);

davidj
02-27-2007, 10:22 PM
and remove this...


<?php
mysql_free_result($Recordset1);
?>


php free's memory automatically once its task is complete

parabol
02-27-2007, 10:24 PM
Hi,

No result, I'll add those changes and reply.

Thanks

davidj
02-27-2007, 10:26 PM
post the code to your Farout.php

its your connection script

parabol
02-27-2007, 10:27 PM
I now have this:


<?php require_once('Connections/Farout.php'); ?>
<?php
$link = @mysql_connect('localhost', $username, $password);
$db = mysql_select_db($database, $link);
$query = "SELECT * FROM phpbb_users";
$result = @mysql_query($query);
$row = @mysql_fetch_array($result);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32">Member List</td>
</tr>
<tr>
<td height="87">

<?php
do {

echo $row_Recordset1['username'].",";

}while ($row = @mysql_fetch_array($result));

?>
</td>
</tr>
</table>
</body>
</html>

davidj
02-27-2007, 10:28 PM
no
your connection script

parabol
02-27-2007, 10:28 PM
No errors now,
but no results either:



Member List,

davidj
02-27-2007, 10:29 PM
i need the code to your connection script

please

parabol
02-27-2007, 10:30 PM
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Farout = "localhost";
$database_Farout = "farout";
$username_Farout = "username";
$password_Farout = "password";
$Farout = mysql_pconnect($hostname_Farout, $username_Farout, $password_Farout) or die(mysql_error());
?>

davidj
02-27-2007, 10:37 PM
ok

try this

edit this line like this...
$link = @mysql_connect('localhost', $username_Farout , $password_Farout);

where you have...


$link = @mysql_connect('localhost', $username, $password); //<<<
$db = mysql_select_db($database, $link);
$query = "SELECT * FROM phpbb_users";
$result = @mysql_query($query);
$row = @mysql_fetch_array($result);

parabol
02-27-2007, 10:44 PM
Hi
I tried that, no result.

I added (_Farout) to
$db = mysql_select_db($database_Farout, $link);

and got this:
Member List,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

There are about 78 or so records in that recordset.
So - something is repeating, just not being displayed.

:)

davidj
02-27-2007, 10:48 PM
post the connection script and the recordset script

parabol
02-27-2007, 10:51 PM
Connection
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Farout = "localhost";
$database_Farout = "farout";
$username_Farout = "username";
$password_Farout = "password";
$Farout = mysql_pconnect($hostname_Farout, $username_Farout, $password_Farout) or die(mysql_error());


Original Recordset
mysql_select_db($database_Farout, $Farout);
$query_Recordset1 = "SELECT * FROM phpbb_users";
$Recordset1 = mysql_query($query_Recordset1, $Farout) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);


New Recordset
$link = @mysql_connect('localhost', $username_Farout, $password_Farout);
$db = mysql_select_db($database_Farout, $link);
$query = "SELECT * FROM phpbb_users";
$result = @mysql_query($query);
$row = @mysql_fetch_array($result);

parabol
02-27-2007, 10:57 PM
Hi

Just added this (_Recordset1) to both of these rows,

$row_Recordset1 = @mysql_fetch_array($result);

I now have a result !!!

davidj
02-27-2007, 11:00 PM
ok

try this... remove the top line of your recordset and replace all instances of $link with $Farout

New Recordset
$db = mysql_select_db($database_Farout, $Farout);
$query = "SELECT * FROM phpbb_users";
$result = @mysql_query($query);
$row = @mysql_fetch_array($result);

if this does not work i need to emulate your model so i can write a solution. I will do this tomorrow as its getting late here in the uk

parabol
02-27-2007, 11:02 PM
Thankyou so much for your help - time to rest.

If I have any more errors, I'll post you.

Thanks again,

Warren

davidj
02-27-2007, 11:02 PM
nice one mate