TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-17-2010, 08:19 PM   #1 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Arrow How to list rows except first one ?

Hello, how can I list rows except first one ? Thank you.
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 05-17-2010, 09:49 PM   #2 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

If the array is numeric:

PHP Code:
$list = array(=> 'adam'=> 'dave');
$length count($list);

for (
$n 1$n $lengthn++) {
   echo 
$list[$n];

__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 05-17-2010, 09:53 PM   #3 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Thanks. But I mean the mysql results. My query is this >

$query="select * from dle_post where $q ORDER BY id DESC limit 10";

I mean how to list items except first one...
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 05-17-2010, 10:04 PM   #4 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Then just pull the data normally and put in a numeric array. That way you can print off the array from the 2nd element.

PHP Code:
$result mysql_query('SELECT * ... ');
$list = array();

while (
$row mysql_fetch_array($result)) {
   
$list[] = $row;

__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 05-17-2010, 11:01 PM   #5 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Sorry but can't understand. What you exactly mean ?
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 05-17-2010, 11:08 PM   #6 (permalink)
The Wanderer
Newcomer 
 
etoolbox's Avatar
 
Join Date: Dec 2008
Location: Auckland, NZ
Posts: 24
Thanks: 0
etoolbox is on a distinguished road
Default

Is this what you want?

$query="select * from dle_post where $q ORDER BY id DESC limit 1, 10";
__________________
Chris Hope's LAMP Blog: http://www.electrictoolbox.com/
etoolbox is offline  
Reply With Quote
Old 05-17-2010, 11:11 PM   #7 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

If its showing last 10 results except the first one, yes its is.
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 05-18-2010, 02:46 PM   #8 (permalink)
The Contributor
 
nefus's Avatar
 
Join Date: Nov 2007
Location: Nashville, TN
Posts: 66
Thanks: 20
nefus is on a distinguished road
Default

The limit on the end of the sql query keeps it from showing the first record because it's 1 instead of 0.
__________________
I am not a programmer, nor do I play one on tv.
nefus is offline  
Reply With Quote
Old 05-22-2010, 02:26 PM   #9 (permalink)
The Wanderer
 
Join Date: May 2010
Posts: 19
Thanks: 1
core1024 is on a distinguished road
Default

you can even
PHP Code:
$r mysql_query('SELECT no, matter FROM whatever WHERE something');
mysql_fetch_assoc($r)
while (
$row mysql_fetch_assoc($r)) {
   echo 
'<pre>'.print_r($row,true).'</pre>';

core1024 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes and db rows Dave Absolute Beginners 7 02-28-2010 08:09 PM
Talkphp's List of Knowledge codefreek General 0 08-06-2009 01:01 AM
How to get row number from 2 top numberd rows ttmtake General 5 01-28-2009 11:16 PM
Status List codefreek TalkPHP Developer Team 12 11-24-2008 12:23 AM
list populating proplem Peuplarchie Absolute Beginners 7 06-09-2008 09:02 AM


All times are GMT. The time now is 04:37 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design