| Author |
Topic |
|
tchague
Starting Member
5 Posts |
Posted - 2010-11-16 : 15:55:20
|
| I'm not sure if what I'm trying to achieve here is possible, and I'm new to SQL so please bare with me....I'm building a database powered website, and the website has a review section which is full of reviews for outdoor equipment. Therefore I've got a review tables with all my reviews in. Upon opening the reviews page a select query selects the review image, rating and name and displays them in table.Now here comes the complicated bit..... From the table I want to some how click the review name/title and it query the database and open up a new page with the review on it itself along with the review image, rating, price and a few other details.Hope someone can help me out, or point me in the right direction. Thanks. |
|
|
TimSman
Posting Yak Master
127 Posts |
Posted - 2010-11-16 : 15:57:15
|
| I'd say you would have to have an underlying value for each displayed name, and pass that back to the database, then have the database pull whatever data you need based on that.That's how I have always done it. |
 |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2010-11-16 : 15:57:20
|
| Seems pretty straight forward. What are you having trouble with?-Chad |
 |
|
|
tchague
Starting Member
5 Posts |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2010-11-16 : 16:03:03
|
| Add a hyperlink column that passes the ReviewID in the querystring.-Chad |
 |
|
|
tchague
Starting Member
5 Posts |
Posted - 2010-11-16 : 16:06:25
|
| Thanks, that makes sense. Know of any tutorials or examples on something about this?I just need something to start me off, as I'm a complete novice with SQL. Thanks guys. |
 |
|
|
TimSman
Posting Yak Master
127 Posts |
Posted - 2010-11-16 : 16:15:47
|
| Do you need help writing the query? Or need help configuring the hyperlink column? |
 |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2010-11-16 : 16:16:39
|
| Are you using ASP.Net for the page? If so a Bing search should provide many examples. Well, actually a Bing search will likely provide many examples regardless of what you are using. I would personally do it in ASP.Net, and use a GridView, which has a column type of HyperlinkColumn. It is pretty easy.-Chad |
 |
|
|
tchague
Starting Member
5 Posts |
Posted - 2010-11-16 : 16:16:54
|
| .... Both, would appreciate your help. :) |
 |
|
|
TimSman
Posting Yak Master
127 Posts |
Posted - 2010-11-16 : 16:54:36
|
| For the query, you wuold ahve to provide information about the table(s) involved, namely the columns and data types.For setting up the gridview, google "gridview hyperlink column". That would be a good start. |
 |
|
|
tchague
Starting Member
5 Posts |
Posted - 2010-11-16 : 18:44:36
|
| I'm not using gridview or asp.net, instead I've got a hyperlink column, and each review has a cell with the following in it: <a href="review.php?id={$review['id']}">NAME OF PRODUCT</a>So when I click the name of the product it takes me to another page where the actual detailed review will be.On the detailed review page, i need to check $_GET['id'] for the ID of the desired review, and run an SQL query to pull all the necessary data for just that review. However I'm having difficulty writing up the code to do this. (here's what I've got up to: http://www.mroutdoors.co.uk/database/database/db_management/product_info/reviews/). Thanks. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2010-11-16 : 20:41:12
|
| We need to know your schema to help you write the query.-Chad |
 |
|
|
|