PDA

View Full Version : Detail Page - HELP


malhyp
12-15-2005, 07:26 AM
Detail Page - HELP
Not working properly.

Hi there to all.

I have created three pages, one a search page, two the results page and three the detail page.

When you search the results page comes up with four four found items.

When clicking on the detail link you get the same details every time.

Eg:
Fred Lamone
- Detail Page Result = Fred Lamone 21 Mithel St Hawthorn.
Trish Baily
- Detail Page Result = Fred Lamone 21 Mithel St Hawthorn.
Troy Gale
- Detail Page Result = Fred Lamone 21 Mithel St Hawthorn.

The detail page results should be different but they are not.

Can anyone suggest why?

Mally R.

Creative Insanity
12-15-2005, 07:56 AM
You have not indexed this from the ID entries.
Make sure you index BY ID.

malhyp
12-15-2005, 08:14 AM
What do you mean by I have not indexed properly.

Is this in the recordset in the results or detail page?

Thanks for your response.

Creative Insanity
12-15-2005, 08:23 AM
The reason you are getting the same result for all searches is that you are only getting the first record in the database (ID 1) so that tells me that the indexing is incorrect.

From a site I created and this is the query for the detal page
mysql_select_db($database_cj_news, $cj_news);
$recordID = $_GET['recordID'];
$query_DetailRS1 = "SELECT * FROM dairy WHERE ID = $recordID ORDER BY date_e DESC";
$DetailRS1 = mysql_query($query_DetailRS1, $cj_news) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);

As you can see I have indexed by the record ID. Which in turn will send the correct record from the database.

domedia
12-15-2005, 01:49 PM
What do you mean by I have not indexed properly.

Is this in the recordset in the results or detail page?

Thanks for your response.
It would REALLY help if you would post your sql query so we don't have to guess :)

Creative Insanity
12-15-2005, 05:34 PM
Oh dom I am not guessing.. I know indexing is incorrect because I have had exactly the same problem and indexing was the cause.

malhyp
12-16-2005, 09:02 AM
I see. My SQL is different.

For the results page it reads.

Dim rsSearchResult
Dim rsSearchResult_numRows
Set rsSearchResult = Server.CreateObject("ADODB.Recordset")
rsSearchResult.ActiveConnection = MM_connTimb_STRING
rsSearchResult.Source = "SELECT SupplierName, Location, ShortDescription, idSupplier FROM Query1 WHERE TimberSpecies LIKE '%" + Replace(rsSearchResult__MMColParam, "'", "''") + "%' AND CategoryTitle LIKE '%" + Replace(rsSearchResult__MMColParam2, "'", "''") + "%' AND Location LIKE '%" + Replace(rsSearchResult__MMColParam3, "'", "''") + "%' ORDER BY SupplierName"
rsSearchResult.CursorType = 0
rsSearchResult.CursorLocation = 2
rsSearchResult.LockType = 1
rsSearchResult.Open()
rsSearchResult_numRows = 0


This is the details page.

Dim rsSupplierDetails
Dim rsSupplierDetails_numRows
Set rsSupplierDetails = Server.CreateObject("ADODB.Recordset")
rsSupplierDetails.ActiveConnection = MM_connTimb_STRING
rsSupplierDetails.Source = "SELECT * FROM Query1"
rsSupplierDetails.CursorType = 0
rsSupplierDetails.CursorLocation = 2
rsSupplierDetails.LockType = 1
rsSupplierDetails.Open()
rsSupplierDetails_numRows = 0

Do you need more?

Creative Insanity
12-16-2005, 09:09 AM
If that is your query it is huge and nothing I have seen before.
Where is the indexing? Like,
$recordID = $_GET['recordID'];

mk9
12-16-2005, 01:48 PM
Hey there Creative Insanity, thanks for the replys. Just figured it out. Would not work because I did not have the WHERE statement in the SQL.

Thanks

Mally.

davidj
12-16-2005, 02:14 PM
that'll do it

Creative Insanity
12-16-2005, 04:40 PM
good stuff :)