// to site admins - sorry for an off topic.
Simple php link code
Moderator: General Moderators
[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
), 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.
// to site admins - sorry for an off topic.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
Sometimes it's easier to write the step down in reverse order, so I want->I need becomes clearer, e.g.
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.
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
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>
- <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
- since parameters are transfered via link, GET-Method is used
- the parameter is called userId, e.g. http://the.serv.er/myscript?userId=9
- php will hold the value in $_GET['userId']
- [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>
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.