Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Eof bof

  1. #1
    Regular Coder
    Join Date
    Sep 2009
    Location
    Calgary, Alberta
    Posts
    228
    Thanks
    45
    Thanked 3 Times in 3 Posts

    Eof bof

    How can you determine the EOF or BOF of your database.?

    I am looking to do something such as when it reaches the end of the database that it will move previous.. and when you reach the BOF of the database how can you make it move next.??

    Thanks, S.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    are you talking about a flatfile database ?? if so BOF is the first line
    eof can be grabbed by feof

    e.g.
    PHP Code:
    while(!feof($stream)){ ... etc 
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Sep 2009
    Location
    Calgary, Alberta
    Posts
    228
    Thanks
    45
    Thanked 3 Times in 3 Posts
    firepages

    sorry .. the database is mysql

    Thanks, S.

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    you would have to find the maximum and minimum values of the primary key ...

    PHP Code:
    $sql="SELECT MAX(`$id_field`) as max, MIN(`$id_field`)  as min FROM `$table` WHERE $where_conditions"
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    Regular Coder
    Join Date
    Sep 2009
    Location
    Calgary, Alberta
    Posts
    228
    Thanks
    45
    Thanked 3 Times in 3 Posts
    I will give this a try.. and let ya know of the progress.

    Thanks for your help..

    S.

  • #6
    Regular Coder
    Join Date
    Sep 2009
    Location
    Calgary, Alberta
    Posts
    228
    Thanks
    45
    Thanked 3 Times in 3 Posts
    How can I show the results to the sql statement..??

    Thanks, S

  • #7
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    obviously I don't know what $id_field and $table are.
    PHP Code:
    $sql="SELECT MAX(`$id_field`) as eof, MIN(`$id_field`)  as bof FROM `$table` ";
    $r=mysql_query($sql);
    $array=mysql_fetch_assoc($r);
    echo 
    $array['bof'];
    echo 
    $array['eof']; 
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •