|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Navigating records
A couple of points around Navigating
i have entered 70 records into mysql and missed one out, My navigation bar flips throught the records in the order they were entered in as I entered them sequentially this was not a problem now i have realised that i have missed one out. Is there any thing i can do short of deleting and reinserting the records. I have a column that relates the sequence of records which is not a priamary key, as the records start at 10 but in time will want to start at 1, I had anticipated this as a problem but not yet proficent enought to deal with it This is a the code for the navigation bar PHP Code:
I have also tried in unscessfully to create a jump menu which would allow you to go direct to a record without scrolling through them. i would like to the menu to dynamically display the content of a column and display the record the you select. all my attempts just leave the jump menu displaying the current record. i have manage to to generate a menu manually that works using html but this is defeating the point of using php <select name="menu1" onChange="P7_JumpMenu(this,1)"> <option value="skmiss.php?pageNum_skmbacis=0~" selected>NUMBER</option> <option value="skmiss.php?pageNum_skmbacis=0~">10</option> <option value="skmiss.php?pageNum_skmbacis=1~">11</option> <option value="skmiss.php?pageNum_skmbacis=2~">12</option> <option value="skmiss.php?pageNum_skmbacis=3~">13</option> <option value="skmiss.php?pageNum_skmbacis=4~">14</option> <option value="skmiss.php?pageNum_skmbacis=5~">15</option> </select> Can you point me in the right direction Graeme |
|
#2
|
||||
|
||||
|
I'm not going to go into this code, but you should really rethink the way you're doing things. Is there any reason for you manually entering the page number (if that's what you're doing)? How does your SQL table look (columns, and the way you have things set up)?
How, specifically, are you ordering the entries? Chronologically? Alphabetically? What's the criteria for the order you put the entries into the table? Please provide more details as to what you're actually doing (or wanting to do). |
|
#3
|
|||
|
|||
|
I have manages to sort the the records in to the correct order by sorting the files by using column I incorporated to describe the magazine issue no.
I have worked out a more precise question. I have a template that the back issues of a magazine are displayed in skm.php how do I define a link to skm.php record (x) defined by column (issue) I would like to display back issue no 15. column (issue ) contains the no. 15 but the id prime key is no 130 the column (issue) is the only column that corresponds to the back issue. Ideally I would like to create a jump menu to take people to the exact back issue they want to view Finally books, I have bought a couple of books on php They introduce php in a very simple way then then immediate jump in to complex situation. I just need to continue looking at more simple scenarios till I grasp the language Can you recommend any books for a simpleton like me. Graeme |
|
#4
|
||||
|
||||
|
Graeme, I see what you're trying to do now. You could have been a lot more descriptive in what you were attempting to achieve in the first place, and then we could have come up with suggestions for you.
So, from what I can gather, you're creating a system whereby magazines are put into a table? The best way of ordering this would be to have a date value (stored in MySQL date format), and order by that value. Ordering by issue number is fine too, but IMO, you really could do with a date field so that when you get the hang of mysql a bit more, you can do links to things like "View last year's magazines" and use a query like this to get all of the issues from last year: PHP Code:
As for your current question, you could have a page called "issue.php". On the menu that lists your issues in your skm.php file, you could have a link like issue.php?issue=<?php echo $row['issue']; ?> and your issue page might be something like: PHP Code:
I've kept that very simple, you should be able to understand what I mean OK. If you're after a really simple book, that gets you off to a good start with both PHP and MySQL, try "PHP Fast and Easy Web Development" by Juli C Meloni. I'll warn you - it IS very, very simple, but has a good case study of putting together a database of your CD collection, something that isn't too far from what you seem to be doing here. It was the first PHP book I bought, going back a few years ago now. You would probably read it within a week, and have it all sussed, but it coasts you easily into a range of issues that you can then expand on through the other books you've bought (which were they, by the way), or through tutorials on the net and the manual. Just be sure that you want something as simple as this book before buying it though.... I don't want to be responsible for you screaming, "I past all of this stuff ages ago". For other book recommendations, do a search through these forums. It's a topic that's been covered umpteen hundred times before ![]() Good luck. |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Navigating records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|