Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

nextrecord

Codes here !

Moderators: macek, egami, gesf

Postby DoppyNL » Mon Aug 12, 2002 12:00 am

I allways do this:
Code: Select all
$query = 'select some_field from some_table where some_field = some_value';
$result = mysql_query($query);

$record = mysql_fetch_array($result);

the last line will get one record from the database each time it is called and places that in an array.

you can use a loop to walk through all records like this:
Code: Select all
while ($record = mysql_fetch_array($result))
{
    do_stuff_with_;
}


Greetz Daan
DoppyNL
 

Postby Desarrollo » Mon Nov 11, 2002 8:54 am

But if you use a form and you want to use "next" and "previous" buttons in a php-page you need to reload your page to update, and if you do that, mysql_connect and mysql_select_db variables are lost.

And if you use a frame to display buttons and other to display info, how do you send that two variables?.

Thanks.
Desarrollo
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Nov 11, 2002 8:48 am


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.