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

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Passing PHP variables from one page to another
Hello-

I'm having trouble figuring out how to transport a variable from one php file to anoth

simple php table loop
Hi all,

I've the following code

<?php // Create category options

xml
<?php

echo "<h1>XML Articles</h1>";

$home

Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I n

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Dynamically allocating the number of rows in a table based on a variable value
Hi,
I have situation here which i cannot resolve, I have a variable temp which stores the num

Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the co

User registration and login
I don't know whether this is the correct forum, if not i apologise but am pretty desperate at the mo

pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that

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