|
Posted by Jerry Stuckle on 07/25/06 21:28
Chris wrote:
> I have a simple search feature that searches 3 fields in 3 separate tables
> in a MySQL db, and I'm getting an 'undefined index' error, but only in the
> first section (first table)of the results. The undefined index is tied to
> the docs.projID in the "if ($row_search['docs.projID'] == 1)". This if
> statement is there to control to format of the link as pages are in
> different depths of subfolders depending on security needs. Googling this
> sort of error seems to reflect problems with the $_POST['keyword'] not
> existing when the results are first listed, so I moved the PHP results code
> from it's own page (search.php) to the main page, which didn't help. I have
> tried several different things and can't seem to get it working right. Here
> is what I have:
>
<snip>
Chris,
What happens if you add the following:
echo "<pre>\n";
print_r($row_search);
echo "</pre>\n";
after your mysql_fetch_assoc? It will tell you the each of the indexes
and their contents.
My suspicion is that 'docs.projID' is not a valid index. Probably 'projID'.
You can also specify a name for it such as:
$query_search = "SELECT Distinct docURL, docTitle, docDesc,
docs.projID AS projID ...
Then it will be $row_search['projID']
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|