Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Changing rows to columns

6:18 pm on Jun 15, 2014 (gmt 0)

New User

joined:June 15, 2014
posts: 1
votes: 0

I had a young fellow who wrote me a simple database query. He is long gone:(

I would like to change it and have been trying, but it is just over my head. So if there is someone with a few minutes who would do it for me, it would be appreciated. What I want is right now, it presents itself with 4 data cells in one row. I would like it to present itself in 4 rows with one data cell.

<title> Ads </title>
<body bgcolor="#C0C0C0" text="#000000" alink="#FF0000" vlink="#FF00FF" link="#0000FF">

<div align="center">
<table class="alt1" border="5" bgcolor="fffceb" cellpadding="6" cellspacing="1" width="100%">
<tr><td colspan="4"><u>WANTED ADS</u> in the <i>Team Classifieds</i>...</td></tr>
$mysql_link = mysql_connect("localhost", "teXXXXXX_root", "XXXXXXXX");
mysql_select_db ("teXXXXXX_forums");
print("Did not connect to database<br>");
function cl_get_ext( $filename ) {
return substr($filename, strrpos($filename,"."));

$result = mysql_query('SELECT p.id, p.cat, p.user, p.userid, p.bigimage, p.title FROM ppc_products p WHERE p.cat=\'58\' OR p.cat=\'59\' OR p.cat=\'60\' OR p.cat=\'61\' OR p.cat=\'62\' ORDER BY RAND() DESC LIMIT 0, 4');
while($row = mysql_fetch_array($result,MYSQL_NUM))
$photo = $row[4];
$photolen = strlen($photo);
$theext = cl_get_ext($photo);
$photo_name = str_replace( $theext, "", $photo );

echo ' <td width="25%"><center><a href=http://www.teXXXXXX.com/classifieds/showproduct.php?product='.$row[0].'>'.

<br />