FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Using mysql_fetch_array()





moejoe
Hi There.

Im using a While() funciton to output my Mysql files.

Here is the line of code im using.

Code:
while($results = mysql_fetch_array($result2)) { }


Basically it gets all the rows in my table.

I want to skip one row in this table.

Its the Second row.

How can i do this? using this function.

Thanks!
MrBlueSky
You can do this:

Code:

$i=0;
while($results = mysql_fetch_array($result2)) {
  if ($i!=1) {
      // do something with $result
  }
  $i++;
}
moejoe
OH MY GOd.

Im dumb.
Thanks. Delete this post please. lol.
DanielXP
Or you could not use that id

Code:
$results2 = MYSQL_QUERY("SELECT * FROM `TABLE` WHERE `id` != '2'");
while($results = mysql_fetch_array($result2)) {
      // do something with $result
}


both will work
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.