Simple php link code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

[a_bit_over_reacting]One more tip for I3lade - the time you spend on writing those "PLEASE HELP ME" posts you should spend on reading some tutorials. You had a question, everone here tried to help (I can even say that they have a very good patience :D ), but saying that you are newbie, doesn't mean that you are not inteligent enough to learn something. Everyone started sometime ago, and had the same problems, but they didn't ask but read, tried and learned. [/a_bit_over_reacitng]

// to site admins - sorry for an off topic.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

delorian wrote:// to site admins - sorry for an off topic.
Perfectly alright, I was thinking the exact same thing, in fact it's only 'cause I went to the movies yesterday (X-Men 2, excellent) that I didn't end up posting something along the same lines.

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I assume your problem, I3lade, is, you do not categorize the problem.
sketch your problem, not as code but as steps - what do you want to do?
Start on a general level, maybe something as basic as
  • show overview of available records
  • [user input]
  • show specific record
and then add more specific notes to each step.
Sometimes it's easier to write the step down in reverse order, so I want->I need becomes clearer, e.g.
  • <end>
  • display the details of a specific record
  • fetch specific record
  • limit request to specific record
    - record must be identified by a unique value
  • get unique value from user input
  • [user input]
  • display link able to transport unique value for each record
  • fetch each available records
  • query records
  • <start>
then start again, in each iteration your notes/steps become more specific
  • <end>
  • display the details of a specific record
    • fields to show: name, give_name, birthdate, ...
  • fetch specific record
    • using a while-loop and mysql_fetch_assoc to fetch each record
  • limit request to specific record
    - record must be identified by a unique value
    • the database table contains an autoincrement field called id identifying each record
    • limit request with a where-clause based on the user-input and the field id
  • get unique value from user input
  • [user input]
    • link activated, a new document is requested
    • all parameters I need, must be transfered with this new request
  • display link able to transport unique value for each record
    • must send the userId via GET
    • want to display name and given name as anchor element's content
  • fetch each available records
    • need to fetch the fields id, name and given_name
    • will use a while-loop and mysql_fetch_assoc
  • query records
    • need to connect to mysql
    • select the database
    • build query that requests all records from table xyz
    • only need the fields id, name and given_name
  • <start>
and so on...
This will help you to structure your problem, the solution and (if needed) your questions.
Try not to mix too many questions but to understand each reply and to integrate suggested solutions until it works as expected.
Post Reply