Page 1 of 1

name that mysql function!

Posted: Sat Mar 25, 2006 8:28 am
by Charles256
What the hell is the name of that mysql function that advances me to the next row without doing a query? it's just a simple little function but it's name escapes me for some damn reason...help?

Posted: Sat Mar 25, 2006 8:38 am
by Buddha443556
One of these?

Code: Select all

mysql_fetch_row();
mysql_fetch_assoc();
mysql_fetch_array();
mysql_fetch_object();

// ... and
mysql_data_seek();

Posted: Sat Mar 25, 2006 9:12 am
by Charles256
good job..i thought it was mysql_data_seek...code...

Code: Select all

$links="SELECT * FROM links";
$getlinks=mysql_query($links);
$link=mysql_fetch_array($getlinks);
mysql_data_seek($getlinks,2); 
															echo $link[0];
should return the second row,first entry, i.e. karts, however it's returning the first row that has scooters in it,the hell?

Posted: Sat Mar 25, 2006 10:03 am
by Charles256
i just did...

Code: Select all

$links="SELECT * FROM links";
$getlinks=mysql_query($links);
$link=array();
while ($test=mysql_fetch_array($getlinks))
{
  static $i=0;
  for ($o=0;$o<4;$o++)
  {
    $link[$i][$o]=$test[$o];
  }
  $i++;
}
go multi-dimensional arrays.

Posted: Sat Mar 25, 2006 8:21 pm
by s.dot
mysql_data_seek($getlinks,2);
Actually that should be returning the 3rd row. 0..1..2