473,385 Members | 1,292 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Search page result links

Hi,

I have a search function pulling data from a MySQL db which works nicely -
other than the fact that I can't get the URL to link correctly when the
linked document is located in the home directory. All other docs are
located below the home directory by group/project/category. When I try to
use an 'if' statement for one of the query parameters, I either lose the
link, get a link that has the doc that is in the home directory with the
full path (that doesn't really exist as folders), or get an undefined index
error. Here is my current code - I have edited it several times over that
past couple of hours, so I have reached the point of not being able to tell
what is correct, and what isn't. I have used projCode, groupCode, projID,
groupID parameters and still can't find the magic solution. I would really
appreciate another set of eyes.

---snip---

mysql_select_db($database_website, $website);
$query_search = "SELECT Distinct docURL, docTitle, docDesc, docs.projID,
groupCode, projCode, catName FROM docs
JOIN subcat on subcat.subcatID=docs.subcatID
JOIN cat on cat.catID = subcat.catID
JOIN groups on groups.groupID=proj.groupID
JOIN proj on proj.projID=docs.projID WHERE proj.projID=docs.projID AND
docURL LIKE '%$keyword%' OR docTitle LIKE '%$keyword%' OR docDesc LIKE
'%$keyword%'";
$search = mysql_query($query_search, $website) or die(mysql_error());
$row_search = mysql_fetch_assoc($search);
$totalRows_search = mysql_num_rows($search);
$proj = $row_search['projCode'];
?>
<?php if ($totalRows_search < 1)
{
echo "No internal documents matched your request.";
}

else {?>

<p><table width=95%>
<tr><td colspan="3"><font size="+1">Internal Documents:</font></td>
</tr>
<tr>
<td><strongLink </strong></td>
<td<strong>Description</strong></td>
<td<strong>Project </strong></td>
</tr>
<?php
do { ?>
<tr>
<td>
<a href="<?php if ($row_search['docs.projID'] == 1) {
echo $row_search['catName']."/".$row_search['docURL'];
}
else {
echo
$row_search['groupCode']."/".$row_search['projCode']."/".$row_search['catName']."/".$row_search['docURL'];
?>"><?php echo $row_search['docTitle'];
} ?></a></td>
<td><?php echo $row_search['docDesc']; ?></td><td><?php echo
$row_search['projCode']; ?></td>
</tr>
<?php } while ($row_search = mysql_fetch_assoc($search)); ?>

</table>

---snip---

Thanks,
Chris
Jul 6 '06 #1
0 1087

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fred Yarbrough | last post by:
We have a simple html page that contains a long list of documents that users can hyperlink to. The entries are currently in alphabetical order and we would like to implement some type of page...
1
by: thomas | last post by:
I'm building a guitar website which uses XML and XSLT. http://www.madtim67.com/guitar/index.html You can search either by artist or song. At the moment my XSL page only returns a result if the...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
2
by: Sriram | last post by:
Hi, i am developing a search page, basically using datagrid. i have given a column as hyperlink so that when the user clicks on it, it gives the details of the selected item in a seperate page....
64
by: Manfred Kooistra | last post by:
I am building a website with identical content in four different languages. On a first visit, the search engine determines the language of the content by the IP address of the visitor. What the...
1
by: duzhidian | last post by:
Dear All: I need write a php program online to implement a super search engine, for example, when users input some keyword, my program can search different other online search engines and reply...
20
by: Pete | last post by:
There's probably a standard answer for this, but it's never cropped up for me before. I have a (png) image that includes some text (a labelled group photo of a conference), and it'd be useful if...
7
by: =?Utf-8?B?SklNLkgu?= | last post by:
How to get search engines crawl data I have a web application that uses user controls and pulls data directly from database and shows it to users in the internet. So there is not html that has the...
5
by: silmana | last post by:
Hi i have this script that i want to use as php or html but i cant find the problem, could anyone solve the problem, i dont know why i cannot use it in php or html file // OBS! Några saker måste...
5
by: th1982 | last post by:
HI All I have a search page' s result which view 3results/per page,but my "next" link to view next page is not working. Here is my code : <?php // Get the search variable from URL ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.