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

Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a sma

Can't shake the "Warning: include()" error
I've just uploaded my site to a new server and where I have PHP include tags in my HTML, the browser

Add weeks in a query?
I have a SQL that summarizes the quantity per week. The weeks that has no value does not exist in th

RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mai

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

Contents of variable not echoing
Hey guys, hopefully this is an easy one...

In this line, the variables are not echoing out. T

ereg_replace issue
hi there people

i have this code happening with regards to my wamp server. is this something

PHP - MySQL Fail
My PHP code will only execute the first part of my code...

Code: <?php

sessio

Problems with array
This code is the last lines in an upload script that uploads 4 images at the same time and writes th

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