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

Posted by Chris on 07/26/06 21:42

>
> 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.
>

I get:

Array
(
[docURL] => index.php
[docTitle] => Debug Home
[docDesc] => Home page of Debug Tools team
[projID] => 1
[groupCode] => common
[projCode] => Home
[catName] => General
)

If I take out the 'docs.' in the $row_search['docs.projID'] (or proj.projID)
my <a href> links don't work for docs in the '1' proj (projID which is
projCode 'Home'). When I change the query as noted below I also lose it.
If I assign a variable to the $row_search['docs.projID'] (or
proj.projID)>>>> $projid = $row_search['proj'], then do the if statement
with the variable (if ($proj == 1) ), my links all work, but I get and
undefined variable error.

But I think we're on the right track. I have changed it back and forth a
few times and haven't given up yet. I may need to change the entire section
of code..as the code for other tables of links listed seem to work just
fine. But they don't have if statements - BTW, I have tried using other
operators with no luck. I've also used the projCode parameter (if
$row_search['projCode'] == 'Home') with no help.

Thanks,

Chris

> 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

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