You are here: Re: undefined index « PHP Programming Language « IT news, forums, messages
Re: undefined index

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация