[VPHP] How to open local vdb from Standalone VPHP?

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Fri Oct 8 07:41:52 CDT 2010


On 10/8/10 3:28 PM, "Roland Farkas" <r.farkas at crocsystems.de> wrote:

Hi Roland,

> We have improve docs of that 2 methods.
> 
> Please let me know if this helps.
> 
> 
> Thanks, yes that helped. I managed to have success to given local database.
> The issue I have now is that the connection works only once. The second time I
> call the script I get this error:
> Warning: valentina: #603396. Valentina is already initialized. in
> /var/www/valentina/test.php on line 5
> 
> Here is my Script:
> --------------------------------------
> <?php
> 
> if (!$link){
> $link = valentina_connect('', '', '');
> }
> 
> if (!$link) {
>    die('Not connected : ' . valentina_error());
> }
>  
> 
> $db_selected = 
> valentina_select_db('/var/www/valentina/countryguides/countryguides', $link);
> if (!$db_selected) {
>     die ('Can\'t use foo : ' . valentina_error());
> }
> $res = valentina_query( "SELECT * FROM glossar" );
> for( $i = 0; $i < valentina_num_rows($res); $i++)
> {
> // getting the hastable/associative array with fields' values
> $arr = valentina_fetch_assoc( $res );
> //
> echo "$arr[uid] $arr[erklaerung] $arr[begriff]";
> echo "<br>";
> }
> valentina_close( $link );
> ?> 
> ---------------------------------------

> How to avoid this? Should not happen I guess, as the there is the
> valentina_close command at the end.

Well, 

Yes, close link probably should do shutdown of engine.

Hmm, I do not like this then...
It is not good idea each time init kill cache and all around.
You will get slow down comparing to case when engine always live.


Is there any way in PHP do this only once ?
And then reuse such $link ?



And again, I need check close()
May be really bug here.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list