Jump to content

Vert Problem


shage

Recommended Posts

<?php
$val = $_GET['rage'];
$tour = $_GET['style'];
$vh = $_GET['shage'];
include 'connect.php';
$sql = mysql_query("SELECT * FROM sites ORDER BY RAND() LIMIT 4") or die(mysql_error());
while($row = mysql_fetch_array($sql, MYSQL_ASSOC)){
$site .= "<td width='50%'>" . $row['site'] . "</td>";
$text .= "<td width='50%'>" . $row['text'] . "</td>";
$site2 .= "<td>" . $row['site'] . "</td>";
$text2 .= "<td>" . $row['text'] . "</td>";
}
?>
<?php if ($vh == "h"): ?>

<table border="5" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" width="40%" id="AutoNumber1" bgcolor="#C0C0C0">
<tr>
<?php echo $site;?>
</tr>
<tr>
<td><?php echo $text;?></td>
</tr>
</table>
</center>
<?php else: ?>

<table width="169" border="0">
<tr>
<?php echo $site2;?>
</tr>
<tr>
<?php echo $text2;?>
</tr>
</table>
</center>
<?php endif; ?>

 

Im trying to echo out 4 random tables from the database, one being horizontal and one being vertical depending on how i call it, this is to pull random products on sidebar and horizontal depending on the page itself. Some reason it only shows horizontal and not vertical I am very new at this stuff so please bear with me

Link to comment
https://forums.phpfreaks.com/topic/71184-vert-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.