Loop column after 2 results


Posted on 16th Feb 2014 07:03 pm by admin

Hello All.

Here is what I have:

Did you know?Explore Trending and Topic pages for more stories like this.
Client ID Company name Client ID Company name

I then need a script to echo 2 results per row then start a new row.

I've tried many things, but never could get a second row to appear. Each row will have 4 columns.

Here is my code without the "guts" My vars will be $id and $company.

$result = mysql_query("SELECT * FROM client");
if(mysql_num_rows($result) < 1)
{
$results = 'You have 0 clients.';
}
else
{
$results = '';
$results .= '<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">';
$results .= '<tr>';

while($row = mysql_fetch_array($result))
{

}
$results .= '</table>';
}
No comments posted yet

Your Answer:

Login to answer
232 Like 12 Dislike
Previous forums Next forums
Other forums

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

Day of week
I am using PHP version 5.0.5
I have a varaible ($DATE (date format yyyy-mm-dd)) that is being inc

Need help with a mail notify function
I was tasked with setting up a site that's been prewritten. The site is basically a form that captur

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want

Custom Container in module pool program
Hello everyone,

I have created a custom control in my module pool screen. Now I want to s

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

Displaying image from database
Hi,

I've got a site where that's got a database behind it. Currently it has loads of items in

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Display thumbnails as square while retaining aspect ratio
I am trying to figure out a way to make an image display as a square, for example 80x80 pixels, when

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash