[EMAIL PROTECTED] wrote:

> Hello
> 
> Following code shows within I have some difficulties. Is only an example
> from "Web Databasse Applications with PHP and MysQL" book.
>  
> global $dsn;
> global $connection;
> 
>  $template->setCurrentBlock();
>  
>  $template->setVariable("SUCH-KRITERIUM","Such-Kriterium:
>  {$_SESSION["searchFormVars"]["search_eb"]}");
>  
>  $browseString = "search_eb=" .
>  urlencode($_SESSION["searchFormVars"]["search_eb"]);
>    
>  $search = ($_SESSION["searchFormVars"]["search_eb"]);
>   
>  $template->parseCurrentBlock();
>  
> 
> 
> $query = setupQuery($_SESSION["searchFormVars"]["search_eb"]);
> $result =
> $connection->query($query);--------------------------------------> This
> code shows me following error message, see below
>    
>   
>    if (DB::isError($result))
>         trigger_error($result->getMessage(), E_USER_ERROR);
>         $numRows = $result->numRows();
>          
> 
> 
> 
> Fatal error: Call to a member function query() on a non-object in
> C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line 81
> 
> Even though the $connection has already been established in a other .php
> file. However, it should work since there is a global declaration.
> 
> best regards, Joerg

Haven't you asked this before? You can't pass a result set or a conection id
from one script to another. Full stop.



Cheers
-- 
David Robley

Washed the cat - took HOURS to get the hair off my tongue!
Today is Prickle-Prickle, the 33rd day of Confusion in the YOLD 3172. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to