• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

MySQL Web Reports

Churnd

Member
I'm trying to find a way to view a table from a mysql database via web page. I'd like to list one record per page, then click an arrow to view the next. Is there an existing project that allows you to do this? My php/mysql knowledge is very limited, and I thought with all of the php/mysql open source projects out there, there might be one that satisfies this requirement.

Thanks in advance.
 
Hmm, not that I've heard of. It would be very, very, very easy to code, though. Usually when people want to view a database via the web it's done in a tabular format (fields as the columns, entries as the rows). This is what phpMyAdmin does, for example.
 
The quickest way would be to throw Ruby on Rails at your database. If you don't have access to Rails, maybe an equivalent framework in PHP will suffice.
 
assuming your rows have a unique row number...


you'd just do somethingl ike.... select * from thetable limit 1 (i think its limit in my sql... you want to look this up). and then , read the id, and look for the next one .

so your linkk to the next item would have the id of the next row. so if you had consecutive ids.. like 1 2, 3 you could just add 1 to the id you got from the select.

or if they arent consecutive say some are deleted, you could pass the last ID, and on the next page when it loads (i'd assume you'd do something like mypage.php?lastid=1 as the link) you could have another select where it is something like select * from table where id > $_get[lastid] limit 1 ... and so on.


to display the data, you'd just have to echo some stuff and the fields you got from the select.
 
Back
Top