|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
help with PHP, MySQL
while ($rad=mysql_fetch_array($result))
{ $echo_arhnr[$m]=$rad["arhnr"]; echo "<A HREF='lugem.php'>$echo_arhnr[$m]</A> , ";} --- I made variables from MySQL database as links. It should look like this: Link1 , Link2 , Link3 , If user clicks on one of these links, he is directed to a new page called 'lugem.php' How can I define, which link he clicked? Because, I want that page ('lugem.php') to display the information requested from MySQL db under the clicked link variable. To make it clear: user clicks Link2. He is directed to 'lugem.php'. Now PHP should request data from MySQL for this Link2. eh, English is hard :/ thx. |
|
#2
|
||||
|
||||
|
the way I would do this is using HTTP-GET (also known as URL Rewriting)
Here's an example which reads the label for the link and an id or information for the other page... PHP Code:
|
|
#3
|
||||
|
||||
|
If you can do better, Spongy, step up. No point in harrassing the moderators, who volunteer time to help people all over the forums and so sometimes miss a line of code in their haste to move to the next floundering programmer's problem.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#4
|
||||
|
||||
|
Alright, looking at my post I did miss something...
echo "<A HREF='page.php?id=".$data['id']."'>".$data['id']."</A> , "; I don't understand what else you want? page.php would need a way to handle the query string... typically $_GET['id'] (from my example)... for example: $result=mysql_query("SELECT * FROM table WHERE id=".$_GET['id']); If you know how this works, did i misinterpet your question? |
|
#5
|
||||
|
||||
|
This is indeed the best way to handle such a problem.
I'm sorry, MadCozDzz... BTW: this was not my question.... |
|
#6
|
||||
|
||||
|
tox,
does this answer your question? Spongy, no hurt feelings |
|
#7
|
|||
|
|||
|
Yes it does, and thank You. And also I'm sorry I didn't get to respond to this post earlier, I was at home all weekend, and have no access to internet over there.
I'm sorry and thanks. Tox |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > help with PHP, MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|