PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Bug Tracker

Reply
 
Thread Tools
Old 06-22-2006, 08:11 AM   #1
shockfreezer
Green Mole
 
Join Date: Oct 2005
Location: Switzerland
Posts: 6
Talking Strange db change behavior [Fix included]

Hi there,

I use a customized script to search with phpDig, that means I include the config of phpDig into my own script and use the functions of "/libs/search_functions" to search with.

The problem of this method is that phpDig's connect to the MySQL server changes the db of my own script. If there are other db-queries after the phpDig search the queries would go to the phpDig db and not to the db of the including script.
This behavior causes in the connection handling of php, if a connection with the same authorisation data would be etablished it changes only the db and generates not a new connection.

To prevent this change the connection code in the file "/includes/connect.php" on line 30, from:
PHP Code:
$id_connect = @mysql_connect(PHPDIG_DB_HOST,PHPDIG_DB_USER,PHPDIG_DB_PASS); 
to:
PHP Code:
$id_connect = @mysql_connect(PHPDIG_DB_HOST,PHPDIG_DB_USER,PHPDIG_DB_PASS,true); 
This additional parameter forces php to create a new connection. So you can be sure there is no db-change for your own script.

Greez
shockfreezer
shockfreezer is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Certain sites, pages and pdfs are not indexed 1.8.9 RC1 [Workaround included] obottek Bug Tracker 0 08-24-2006 06:30 AM
Spider CLI call under Windows fails [Workaround included] shockfreezer Bug Tracker 0 06-22-2006 07:58 AM
files above 2 levels can not be included using require_once or include ravi Coding & Tutorials 0 06-15-2006 04:33 AM
Exclude not working 1.8.9 RC1 (Workaround included) shockfreezer Bug Tracker 1 05-16-2006 01:55 AM
PhpDig spiders included menu: wrong results nicor Troubleshooting 3 03-25-2004 05:58 AM


All times are GMT -8. The time now is 03:34 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.