creating links from sql query results
Posted: Fri Mar 16, 2007 6:43 pm
Hello all.
I am designing a web site in php. I am working on creating a page that takes user input, searches a SQL db, and returns the result. I would like to then create a unique link for each primary key that is returned. So that by clicking this link, the user will be taken to a page that displays all info regarding that entry. My problem is when I get the results back. I have the information, can post it to the page, and create the link out of it (the <a href=></a> tags with info) , I just can't seem to make a link based on that. The only information I need to get to the next page, call it the info page, would be which primary was clicked -- I don't mind making the query a second time once I get to the info page either. So basically out of a list the user sees as results from their query, I want to know which one the user has selected and then go to the info page.
I am pretty sure I could do this with a form and radio buttons, and then save the result to the _SESSION array, but I would rather stay away from the use of radio buttons. I bring it up only to help clarify what I am trying to accomplish.
I do appoligize for posting, but I have searched a lot for this answer, and I can't imagine its more then a few lines of code either. I appreciate any responses or hints to the right direction I can get.
soloslinger
I am designing a web site in php. I am working on creating a page that takes user input, searches a SQL db, and returns the result. I would like to then create a unique link for each primary key that is returned. So that by clicking this link, the user will be taken to a page that displays all info regarding that entry. My problem is when I get the results back. I have the information, can post it to the page, and create the link out of it (the <a href=></a> tags with info) , I just can't seem to make a link based on that. The only information I need to get to the next page, call it the info page, would be which primary was clicked -- I don't mind making the query a second time once I get to the info page either. So basically out of a list the user sees as results from their query, I want to know which one the user has selected and then go to the info page.
I am pretty sure I could do this with a form and radio buttons, and then save the result to the _SESSION array, but I would rather stay away from the use of radio buttons. I bring it up only to help clarify what I am trying to accomplish.
I do appoligize for posting, but I have searched a lot for this answer, and I can't imagine its more then a few lines of code either. I appreciate any responses or hints to the right direction I can get.
soloslinger