Jump to content
Larry Ullman's Book Forums
BHB

Module Search Extending,.. (Chapter 2, Page 70)

Recommended Posts

I hope this is the right place to ask this question.

 

I have been building a site with pedigrees and using parts of multiple Ullman books.

 

My regular site search is working well returning a table with edit button. I can type in say 'ca' and returns all names with ca in the name.

 

I have year born edit/update working but have not got my father/mother edit/update to work yet. I am asking theory question rather than code question...

 

I do not want to use a drop list to update father/mother because that list will be much too long. (as in 'artist' chapter 17 page 550 PHP6 MySQL 5) I like how my site search is working to make this first list but don't know if it is truly possible to then use it for search/update; all these editable items on one page? To have an edit button next to each item on list seems silly. SHould I be looking at ajax? ... I am trying to wrap my mind around the flow since I figured out that having multiple separate forms per page causes errors I can't seem to manage. Probably OOP which I have not dived into yet. I need a simple solution at this point in my coding career. The recursion functions (chapter 1) still bother my brain and so I just coded each in pedigree with a long query for now. HA! It works and I hope lights go off after writing these long queries..someday.

 

I would like this new search/update to return a list. That should be radio buttons to choose the correct father/mother; I have unknown father and unknown mother as defaults since those names have to be added in database before they can be linked. Usually people start at the bottom and work back, not vice versa.

 

I always ask question when my brain gets fried. Suppose I should wait 24 hours and it will just come to me. But, I am sure there are many ways to approach and just curious if anyone has worked on such search/update; or multiple forms updates per page. Thought about using include files for each father mother BUT I need the originating array id to link to. grrrr...

 

Thanks

BHB

Share this post


Link to post
Share on other sites

This is a fine place to ask such a question. Unfortunately, I've read your post now a couple of times and can't make heads or tails of what you're trying to do or asking.

Share this post


Link to post
Share on other sites

:)

 

Ok, say a form (update) has following fields

 

Horse Id is passed hidden

Horse name is visual reference

 

Sire name (I'd)

Dam name (ID)

Gender

Breed

Year born

 

If there is a thousand names in db a drop select is not the way to go to change sire and or dam but I don't want duplicate entries either. So if either of the sire or dam fields need to be edited I would like to return a page with 'like' suggestions as radio buttons; choose the correct sire dam with option "I don't see the horse" and add new name at that point. From there actual update happens... Many horses could be named X since db covers many breeds.

 

So keeping it simple (without Ajax) maybe I post to new page ,. So as not to get too messy for now. Ififf statement update of sire or dam go this way, else other post.. The iff sire dam would actually be search query returning two radio lists? Can I pull this off in one form? I am working on my road map, what will be my best plan? I could show code for search if you think it helps.

 

Took a break today to start fresh mon. Sorry I am not clear.

 

 

Share this post


Link to post
Share on other sites

Woke up with some ideas to try. Will write a herd of if else and post to a new page for now. If someone enters a new year born but nothing else they will skip on,.. Post back to same page actually would be best. But if change sire or dam would post to a list no different than your search form, just two at once. I just add radio button and continue the form to a final; carry the gender, year born and original horse ID past second page in hidden fields. Update q on this final page. Then I can work towards getting it on one page from there.

 

Read Ajax grid this am and that can wait!!! Good gracious. Did not like the book example (not yours); GET without validatioins. Scary!

 

 

Always having fun! I am right brain if you had not guessed by now. Painter... Code warms my brain up. I paint better after a couple hours of studying. :)

 

Have to go to real work. Will post my attempt.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...