SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
May 31, 2007, 17:24 #1
- Join Date
- May 2007
- Posts
- 27
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Show data from mysql in two columns php
Hello
If I have the following code
if(!isset($_GET['id']))
{
$self = $_SERVER['PHP_SELF'];
$query = "SELECT id, nombre_of FROM oficinas ORDER BY id";
$result = mysql_query($query) or die('Error : ' . mysql_error());
$direccion = '<ol>';
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
list($id, $nombre_of) = $row;
$direccion .= "<li><a href=\"$self?id=$id\">$nombre_of</a></li>\r\n";
}
$direccion.= '</ol>';
Sorry, my english is not good
help me, please!!!!!!!
-
May 31, 2007, 17:34 #2
Ten rows per column:
Code php:if(!isset($_GET['id'])) { $self = $_SERVER['PHP_SELF']; $query = "SELECT id, nombre_of FROM oficinas ORDER BY id"; $result = mysql_query($query) or die('Error : ' . mysql_error()); $direccion = '<div style="float:left"><ol>'; $i=1; while($row = mysql_fetch_array($result, MYSQL_NUM)) { list($id, $nombre_of) = $row; if($i++%10==0) $direccion .= '</ol></div><div style="float:left"><ol>'; $direccion .= "<li><a href=\"$self?id=$id\">$nombre_of</a></li>\r\n"; } $direccion.= '</ol></div><br style="clear:both" />';
Saul
-
May 31, 2007, 18:01 #3
- Join Date
- May 2007
- Posts
- 27
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
not workink php_daemon
show list of data 1-9 in order list
10 - rest unorder list
and the rest of the list in unorder list, example
1 *
2 *
3 *
4 *
5 *
6 *
7 *
8 *
9 *
-
-
-
-
-
-
Jun 1, 2007, 05:47 #4
Well, I was kinda hoping you will adjust it to what you need; it's just the basic idea.
Saul
-
Jun 1, 2007, 12:36 #5
- Join Date
- May 2007
- Posts
- 27
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks php_daemon
solved problem
Bookmarks