Closed Thread Icon

Topic awaiting preservation: HELP!! PHP ALL OF A SUDDEN WON'T CONNECT TO DB!!! HAAAAAAAAAAAAAALP!!!!!!!! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30216" title="Pages that link to Topic awaiting preservation: HELP!! PHP ALL OF A SUDDEN WON&amp;#039;T CONNECT TO DB!!! HAAAAAAAAAAAAAALP!!!!!!!! (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: HELP!! PHP ALL OF A SUDDEN WON&#039;T CONNECT TO DB!!! HAAAAAAAAAAAAAALP!!!!!!!! <span class="small">(Page 1 of 1)</span>\

 
paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-19-2008 13:55

This is insane - I'm practically on my wits end here. FOr some stupid non reason my php project has just died out on me in teh most unexplainable of ways. I found out that for some reason the database code which connects to the mysql database isn't doingf its job ata ll and instead it returns a NUll value instead of a link identifier.

So becasue of that I can't see any links to any modules I have as all teh module data are in a database - except for the hello page and settinsg page. But the weird thing is this that for some weird reason teh databsae functiosn only seem to be working on one solitary page i.e teh settings page. It makes no sense I can change my password but thats it I can't do anything else. Plus its the same db file which is included in all other pages. SO why is it sowkring here and nowhere else.

Plus it was working quite fine - I didn't change a single shred of code here I mean I could swear on that I even reverted my propgram back to the last stable version I had - but even then its acting up...

WHat do I do man I'm screwed and seriously thinking of dousing my pc with kerosene and watching it go up in flames!!!!!!!!

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-19-2008 14:30

Hm... can't you use your source control to check on what changed?
Could there be some other code overwritting your database connection settings?
Also, are you drunk ? You're making very many typos .

so long,

->Tyberius Prime

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-19-2008 14:38

NAh I don't drink.. I'm just frustrated!!!! Right now I'm trying to undo everychange I have so far - but form teh looks of it the earliest working version might end up to eb a blank page ...

ANy thing I should be looking at

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-19-2008 14:42

does your db actually still work? (phpmyadmin)

Are you redefinging the "$DB_SERVER" anywhere (a quick find -name "*.php" | xargs grep -Ri DB_SERVER should tell you that...), etc.

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-20-2008 07:21

Well it does and that is whats boggling me! I mean like in my very same web project only one silly module is connecting to the db as normal but the rest is just dead!!!!

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-20-2008 08:54

Hmm I just noticed one thing here. On my login page I have this Ajax script set up my session variables upon authentication and then it redirects to the main index page. The db is being accessed fine enough in the login page and teh sesison variables are being set. However when it is redirected to the index page - the session variables are now all blank!

Information such as username plus modules allocated are storred in session variables. SO I don't think its much of a database issue as it is a session issue. The session variables are all null when its redirected what should I be looking for here.

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-20-2008 09:08

EEEEPS!!!! Mega update - my stupid session variables aren't working at all. Basically the flow of the work was that I would login and populate my session variables - I would access my session variables witha simple helper function _get_session(var). However for some weird reason my session variables seem to have no scope at all.

When I fill them up using one function by the time I try to access them using a nother function - they're empty by then!!!!!?!??!?!?!?!? What the hell is going on here!?!?!?!?!??!?!?!

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-20-2008 09:37



Man this is just another one of those days when you really feel like there isn't anyone dumber than yourself. Aparently I was storing teh session variables in a database -one of which was a serialized object and whenever I required to regenerate the sessions I would read from the database.

However the dumb DUMB DUMB DUMBERERERERERERERST thing I did was that I was for some stupid reason calling unserialise TWICE on the serialised objected resulting in a perfectly unserialised object turning to the omnious null value - hoo boy times like this I feel I really need a vacation.

Thanks guys for the support.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-20-2008 20:33

nah... you need unit tests

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 04-21-2008 08:35

unit what?????

Blaise
Paranoid (IV) Inmate

From: London
Insane since: Jun 2003

posted posted 04-21-2008 11:10

Yeah, Test driven development FTW!

kuckus
Paranoid (IV) Mad Librarian

From: ber/ger
Insane since: Dec 2001

posted posted 04-21-2008 21:32

Which reminds me I always meant to get more into that with my Django apps, thanks

« BackwardsOnwards »

Show Forum Drop Down Menu