Re: [PHP-DB] results on multiple pages
Are there any people who know the way to display results on multiple pages if using Oracle database (preferrably using PHP Oracle finctions and not Oracle8 functions)? Best Regards, Maxim Bubnov Richard Emery [EMAIL PROTECTED]: Why don't you let mysql sort and limit the records for you? That's easy enough. Just keep track of where you are in the database and select only the records that you need. - Original Message - From: James Kupernik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 16, 2002 3:20 PM Subject: [PHP-DB] results on multiple pages I am retrieve records from my MySQL table and I want to display the results 12 per page along with allow for a sort. I was just send a query to the table with a limit each time, but it didn't sort all the records, so I need to load all the results into a table to sort then display. Here is what I have for code ?php Mysql_connect(localhost,user,pass); mysql_select_db(countryloft); if (!$nextpg) { $i = 0; } else { $i = $i + 12; } $prodTbl = mysql_query(select * FROM countryloft WHERE category LIKE '%folk%' ORDER BY displayorder); $num_results = mysql_num_rows($prodTbl); $itemsPerPage = 12; echo table; $mycolumn = 1; $maxcolumn = 3; file://loop table until end of results for ($i=$i; $i $itemsPerPage; $i++) { $row = mysql_fetch_array($prodTbl); echo td width=200 align=centera href=productinfo.php?prodID=.$row['record'].img src=http://www.thecountryloft.com/countryloft/yellowpics/.$row['image3']. border=0; echo brfont size=2.$row['title']./font; echo brfont size=2.$row['price']./font/td\n; if ($mycolumn == $maxcolumn) { echo /tr; } $mycolumn = $mycolumn + 1; if ($mycolumn $maxcolumn) { $mycolumn = 1; } } echo /table\n; echo a href=$PHP_SELF?i=$inextpg=yesNext Page/a; ? Any help would be great!! Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] results on multiple pages
I am retrieve records from my MySQL table and I want to display the results 12 per page along with allow for a sort. I was just send a query to the table with a limit each time, but it didn't sort all the records, so I need to load all the results into a table to sort then display. Here is what I have for code ?php Mysql_connect(localhost,user,pass); mysql_select_db(countryloft); if (!$nextpg) { $i = 0; } else { $i = $i + 12; } $prodTbl = mysql_query(select * FROM countryloft WHERE category LIKE '%folk%' ORDER BY displayorder); $num_results = mysql_num_rows($prodTbl); $itemsPerPage = 12; echo table; $mycolumn = 1; $maxcolumn = 3; //loop table until end of results for ($i=$i; $i $itemsPerPage; $i++) { $row = mysql_fetch_array($prodTbl); echo td width=200 align=centera href=productinfo.php?prodID=.$row['record'].img src=http://www.thecountryloft.com/countryloft/yellowpics/.$row['image3']. border=0; echo brfont size=2.$row['title']./font; echo brfont size=2.$row['price']./font/td\n; if ($mycolumn == $maxcolumn) { echo /tr; } $mycolumn = $mycolumn + 1; if ($mycolumn $maxcolumn) { $mycolumn = 1; } } echo /table\n; echo a href=$PHP_SELF?i=$inextpg=yesNext Page/a; ? Any help would be great!! Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] results on multiple pages
Why don't you let mysql sort and limit the records for you? That's easy enough. Just keep track of where you are in the database and select only the records that you need. - Original Message - From: James Kupernik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 16, 2002 3:20 PM Subject: [PHP-DB] results on multiple pages I am retrieve records from my MySQL table and I want to display the results 12 per page along with allow for a sort. I was just send a query to the table with a limit each time, but it didn't sort all the records, so I need to load all the results into a table to sort then display. Here is what I have for code ?php Mysql_connect(localhost,user,pass); mysql_select_db(countryloft); if (!$nextpg) { $i = 0; } else { $i = $i + 12; } $prodTbl = mysql_query(select * FROM countryloft WHERE category LIKE '%folk%' ORDER BY displayorder); $num_results = mysql_num_rows($prodTbl); $itemsPerPage = 12; echo table; $mycolumn = 1; $maxcolumn = 3; file://loop table until end of results for ($i=$i; $i $itemsPerPage; $i++) { $row = mysql_fetch_array($prodTbl); echo td width=200 align=centera href=productinfo.php?prodID=.$row['record'].img src=http://www.thecountryloft.com/countryloft/yellowpics/.$row['image3']. border=0; echo brfont size=2.$row['title']./font; echo brfont size=2.$row['price']./font/td\n; if ($mycolumn == $maxcolumn) { echo /tr; } $mycolumn = $mycolumn + 1; if ($mycolumn $maxcolumn) { $mycolumn = 1; } } echo /table\n; echo a href=$PHP_SELF?i=$inextpg=yesNext Page/a; ? Any help would be great!! Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] results on multiple pages
I don't understand what you're saying - Original Message - From: James M Kupernik [EMAIL PROTECTED] To: 'Richard Emery' [EMAIL PROTECTED] Sent: Tuesday, April 16, 2002 4:05 PM Subject: RE: [PHP-DB] results on multiple pages Because if I limit the record sort, then if the record I want at the top is last, it won't catch it because of the limit. -Original Message- From: Richard Emery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 16, 2002 4:44 PM To: James Kupernik Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] results on multiple pages Why don't you let mysql sort and limit the records for you? That's easy enough. Just keep track of where you are in the database and select only the records that you need. - Original Message - From: James Kupernik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 16, 2002 3:20 PM Subject: [PHP-DB] results on multiple pages I am retrieve records from my MySQL table and I want to display the results 12 per page along with allow for a sort. I was just send a query to the table with a limit each time, but it didn't sort all the records, so I need to load all the results into a table to sort then display. Here is what I have for code ?php Mysql_connect(localhost,user,pass); mysql_select_db(countryloft); if (!$nextpg) { $i = 0; } else { $i = $i + 12; } $prodTbl = mysql_query(select * FROM countryloft WHERE category LIKE '%folk%' ORDER BY displayorder); $num_results = mysql_num_rows($prodTbl); $itemsPerPage = 12; echo table; $mycolumn = 1; $maxcolumn = 3; file://loop table until end of results for ($i=$i; $i $itemsPerPage; $i++) { $row = mysql_fetch_array($prodTbl); echo td width=200 align=centera href=productinfo.php?prodID=.$row['record'].img src=http://www.thecountryloft.com/countryloft/yellowpics/.$row['image3' ]. border=0; echo brfont size=2.$row['title']./font; echo brfont size=2.$row['price']./font/td\n; if ($mycolumn == $maxcolumn) { echo /tr; } $mycolumn = $mycolumn + 1; if ($mycolumn $maxcolumn) { $mycolumn = 1; } } echo /table\n; echo a href=$PHP_SELF?i=$inextpg=yesNext Page/a; ? Any help would be great!! Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php