name that mysql function!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

name that mysql function!

Post 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?
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

One of these?

Code: Select all

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

// ... and
mysql_data_seek();
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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?
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

mysql_data_seek($getlinks,2);
Actually that should be returning the 3rd row. 0..1..2
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply