Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
Re: [PHP] OOB problem, super stumped.
Old
  (#1)
Robert Cummings
Guest
 
Posts: n/a
Default Re: [PHP] OOB problem, super stumped. - 06-02-2007, 08:55 PM

On Tue, 2007-05-29 at 22:36 -0400, Brian Seymour wrote:
> I am super stumped. This works fine separately but when I put everything
> together it breaks. I has an authenticate cl*** and a sql cl***. However I
> always get the same error.


The following line:

> $this->conx=$this->connection($host,$user,$p***);


Completely buggers things up. The connection() method doesn't return a
value. So the next query has a null resource and so fails and generates
the error you are seeing. You've already set the value of $this->conx in
your connection() method so even if you did return the resource
identifier it would be redundant.

Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

RE: [PHP] OOB problem, super stumped. (resolved)
Old
  (#2)
Brian Seymour
Guest
 
Posts: n/a
Default RE: [PHP] OOB problem, super stumped. (resolved) - 06-02-2007, 08:55 PM

Strangely enough the only thing that was wrong was:

$this->result=mysql_query($query, $this->conx);

I removed $this->conx so it looked like

$this->result=mysql_query($query);

And now everything works perfect. I also fixed the line you recommended I
fix. I must have overlooked that =D. But anyhow, problem solved.

Brian Seymour
AeroCoreProductions
http://www.aerocore.net/
-----Original Message-----
From: Robert Cummings [private.php?do=newpm&u=]
Sent: Tuesday, May 29, 2007 10:51 PM
To: Brian Seymour
Cc: 'php php'
Subject: Re: [PHP] OOB problem, super stumped.

On Tue, 2007-05-29 at 22:36 -0400, Brian Seymour wrote:
> I am super stumped. This works fine separately but when I put everything
> together it breaks. I has an authenticate cl*** and a sql cl***. However I
> always get the same error.


The following line:

> $this->conx=$this->connection($host,$user,$p***);


Completely buggers things up. The connection() method doesn't return a
value. So the next query has a null resource and so fails and generates
the error you are seeing. You've already set the value of $this->conx in
your connection() method so even if you did return the resource
identifier it would be redundant.

Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
RE: [PHP] OOB problem, super stumped. (resolved)
Old
  (#3)
Robert Cummings
Guest
 
Posts: n/a
Default RE: [PHP] OOB problem, super stumped. (resolved) - 06-02-2007, 08:55 PM

On Tue, 2007-05-29 at 23:07 -0400, Brian Seymour wrote:
> Strangely enough the only thing that was wrong was:
>
> $this->result=mysql_query($query, $this->conx);
>
> I removed $this->conx so it looked like
>
> $this->result=mysql_query($query);


NO NO NO... don't do that. If you remove the link identifier then
mysql_query() defaults to the last connection opened. In which case if
you make more than one DB connection, you'll have connection soup.

Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
RE: [PHP] OOB problem, super stumped. (resolved)
Old
  (#4)
Richard Lynch
Guest
 
Posts: n/a
Default RE: [PHP] OOB problem, super stumped. (resolved) - 06-02-2007, 08:56 PM



On Tue, May 29, 2007 10:07 pm, Brian Seymour wrote:
> Strangely enough the only thing that was wrong was:
>
> $this->result=mysql_query($query, $this->conx);
>
> I removed $this->conx so it looked like
>
> $this->result=mysql_query($query);


Put that back!!!

Otherwise, when you add some *OTHER* cl***/pacakage that uses some
other MySQL connection, you'll end up using their connection and not
your connection, as mysql_* uses the last-opened connection by
default.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top