|
|
Major error...
Posted under Development by Twyst (---.hs.telusplanet.net) on Sunday September 24 2000 @ 05:43AM EDT
|
Well, i've run into a rather severe error. If I try to access a mysql db for my own code, invariably I get errors with phpweblog not being able to connect to the right db. I can USUALLY fix this by closing my connection, but I have no idea why this happens...
|
|
|
jason writes on Sunday September 24 2000 @ 01:39PM EDT: [ reply | parent ]
When you include "/include/common.inc.html", this opens a non-persistant connection to your phpWebLog database. I'm not sure exactly whats going on here though. What is the error message, and are you including common.inc.php?
|
Twyst writes on Sunday September 24 2000 @ 02:48PM EDT: [ reply | parent ]
Yep, I'm including common.inc.php.
A workaround that I've been using is either to do all my mySQL processing BEFORE I call common.inc.php, or use this code before I call footer.inc.php:
$db = mysql_connect($G_HOST,$G_USER,$G_PASS);
@mysql_select_db($G_DB) or die("Unable to connect to database $G_DB. Be sure to edit include/common.inc.php.");
include("/phpweblog/include/footer.inc.html");
If it's in a function, I have to declare $G_HOST, $G_USER,$G_PASS and $G_DB as global.
|
|
|
|