Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:27 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Need to know syntax for this Query.
PostPosted: Wed Oct 11, 2006 3:02 pm 

Points:
What if I wanted to pull some stuff from the databse but starting from a certain point? Like I have the field 'id' and I want to only pull the rows where id = 6 and onwards.


Report this post
Top
  
Reply with quote  
 Post subject: Answer
PostPosted: Wed Oct 11, 2006 4:29 pm 

Points:
Use MySQL "LIMIT" command. First number is starting point and second is max results.

[php]
<?php
$id = '6';
...
$query = 'SELECT * FROM `my_table` LIMIT '. $id. ', 200';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
...
?>
[/php]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 11, 2006 5:10 pm 

Points:
Ah I thought the only argument LIMIT could take was the max results.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]