...

View Full Version : Display data



poyor7
11-01-2006, 06:27 AM
Hi..
My Problem:

I've one table that have only one field that is entry_num.

So i would like to display all data from this table...my code is quite simple:
$db->query(sprintf("SELECT * FROM %s ",
"entry_num"));

$i=0;

while ($i <= $db->num_rows()){

$db->next_record();

$str .= urlencode(sprintf($db->f("entry_number")));

$i++;

}


My biggest problem when i want to display, the data show in one row 123456788 continously...so how to separate the data like 123 456 788...if it could be done ine table please just show what should i add in the coding

homerUK
11-01-2006, 07:35 AM
what is it you need to show? If it's a gap between the numbers every third one, why not set another increment and put a space...eg



$x = 1;
while ($i <= $db->num_rows()){

$db->next_record();

$str .= urlencode(sprintf($db->f("entry_number")));
if ($x == 3) {
echo "&nbsp;"
$x = 1;
} else {
$x++;
}
$i++;

}



is that what you mean? Sorry if I've misunderstood!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum