Announcement

Collapse
No announcement yet.

SQL with PHP again

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL with PHP again

    Does MySql have the ability to MoveNext, MovePrevious, and MoveLast as it is in Access DBs ...???

    If yes Plz tell me how ???

  • #2
    You can definitely do a MoveNext equivalent:
    Code:
    	$result = mysql_query("SELECT * FROM authors", $link);
    	while($r = mysql_fetch_array($result)) {
    		extract($r, EXTR_PREFIX_ALL, "auth");
    		# Do something with $auth_*
    	}
    As for the others...I'll sit and wait with you

    Comment


    • #3
      Simple.... use mysql_data_seek().
      PHP Code:
      // MoveFirst
      mysql_data_seek($result,0);


      // MoveLast
      // (haven't tested, but should work)
      mysql_data_seek($resultmysql_num_rows($result)-1); 

      Comment


      • #4
        Thanx friends ....

        I'll test them now ...

        Comment


        • #5
          They worked ..

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X