This is a discussion on "PHP/MYSQL Displaying records" within the PHP Forum section. This forum, and the thread "PHP/MYSQL Displaying records are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP/MYSQL Displaying records
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Hey guys,
I am pretty new to php/mysql but have just finished makeing a database of trip reports and a php/html form so users can submit there trip reports directly to the mysql databse. I have read how to output all this information but what i really need to do is output in a specific way: I need to only display about 120 characters of the the trip report (as most are over 800 characters) but with a link to a new page where the full trip report can be read. Is there any way of doing this and also is there anyway php can generate a new page for each record that is submitted? as in if records id 406 is just submitted it has its own page of 406.php? hope that makes sense and hope you can help!! |
|
|
|
||||
|
Re: PHP/MYSQL Displaying records
check php.net
Good information and check the forum. There might be someone there with an answer to your question also.
Last Blog Entry: More Sara Blogging (Nov 29th, 2007)
|
|
|||
|
well ive looked absoloutly everywhere and feel like im now going round in circles.
I have managed to put together some php that displays the last 5 records from my database (excluding the trip report as its very long) but i need to add a link to the data that gets outputted so that when its clicked it takes u to a new page that displays that record u clicked with all its information (trip report included) been looking at some file.php?id=234 but tried it and no luck - am i on the right track?? for some reason when i go that route just displays the information already displayed?!?! if anyone can help would be VERY much appreciated!! |
|
||||
|
Re: PHP/MYSQL Displaying records
Yea, that looks good. If you put the requested id in the link (ex. http://www.yoursite.com/file.php?id=234) then you can read it out like this: $_GET['id'] or $_REQUEST['id']; and use that to read the right trip out of the databank and output it.
Here's an example of how you could do it using PHP and mySQL:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
|||
|
Thank you c010depunkk we have a genius in our presence!!
All seems to be working nicely (just gotta get rid of some kinks and tweak a little my end) Thanks again! |
|
|||
|
Re: PHP/MYSQL Displaying records
Ok getting close!!! heres my code:
and links all the records and rows after the first record?? It seems to not close the <a href> tag? tried playing about with it but seems something very small im overlooking? help would be much appreciated and sorry for being a pain! |
|
||||
|
Re: PHP/MYSQL Displaying records
You forgot to close the quotation marks and the tag on the link. This should work:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
![]() |
| Tags |
| php mysql records |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help in displaying records in single row | anilreddy76 | Databases | 0 | Sep 18th, 2007 17:53 |
| Displaying MySQL database tables on a page | vandiermen | PHP Forum | 3 | Jun 30th, 2007 21:58 |
| Displaying an Image in php via path in MYSQL | chimp | PHP Forum | 1 | Jul 5th, 2006 09:43 |
| reversing records | benbacardi | Classic ASP | 2 | Sep 4th, 2004 16:59 |
| Random records.. | u2orange | Databases | 6 | Mar 8th, 2004 09:31 |