Re: [PHP] OOB problem, super stumped.



Brian Seymour wrote:
Jim,
I put the link identifier back and made your recommended changes and now
everything works perfect. Can't thank you enough.

Is the reason you have to call the parents __construct() method because the
open mysql connection only exists within the scope of the object it was
created in, unless specified otherwise(calling parents constructor)?
no, you are looking at three different scopes here.

One is the mysql_* function in general. The resource $link_identifier is completely optional.

Read the parameters section and link_identifier section

http://us2.php.net/mysql_query

Now, since you are dealing with two different classes, SQL and Authentication, you are deal with yet another two different scope, one for each class.

SQL, by itself has a scope that contains your original $this->conx property. It only exists within your object called $database.

Now, the final scope is within the Authentication object $auth. Since Authentication extends the SQL classes it will inherit a new/different instance of the SQL class/object. Now, since it is a new copy of the SQL $this->conx does not exists. So, to make the SQL class that is being inherit have the $this->conx property, you have to call the __construct() method for the parent/SQL class.

Hope I haven't confused you even more.

Ask away if you have any questions.


Brian Seymour
AeroCoreProductions
http://www.aerocore.net/

-----Original Message-----
From: Jim Lucas [mailto:lists@xxxxxxxxx] Sent: Wednesday, May 30, 2007 12:02 AM
To: Brian Seymour
Cc: 'php php'
Subject: Re: [PHP] OOB problem, super stumped.

You didn't call the __construct() method of your parent.

The above code, should be like this

public function __construct($host,$user,$pass,$dbname = null) {
parent::__construct($host,$user,$pass,$dbname);
echo "Auth constructed";
}

You were forgetting to call to the parent and have it initialize the DB connection.

In the second part, the $auth->verifyCreds() call, it didn't create a valid db connection to pass as the second arg to the mysql_query() call.

And by not passing the $this->conx as the second arg, you are telling it to "use the most recently opened mysql connection.

Hope this clears up why it was failing on the latter mysql_query() calls.



--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Unknown
.



Relevant Pages

  • Re: Get column value
    ... There is only one SQL database server that uses compiled procedures. ... It's due to the need to compile the ... childs deleted ... parents deleted ...
    (microsoft.public.dotnet.languages.vb)
  • Serializing/Loops/Orchestration-Called-Pipelines/Scopes
    ... Client drops a large XML file with multiple records on our FTP server. ... BTS2006 sends the single-record XML files, one at a time, to SQL. ... This is because my correlation set would be initialized ... I was reading that a scope can have ...
    (microsoft.public.biztalk.general)
  • RE: Serializing/Loops/Orchestration-Called-Pipelines/Scopes
    ... Client drops a large XML file with multiple records on our FTP server. ... BTS2006 sends the single-record XML files, one at a time, to SQL. ... This is because my correlation set would be initialized ... I was reading that a scope can have ...
    (microsoft.public.biztalk.general)
  • Re: Onto a potential relational manipulation language
    ... that you would consider most subsets of SQL. ... For the moment only basic relation operators are covered. ... know the scope of your db's features. ... thinking would be D&D Algebra but there are others, ...
    (comp.databases.theory)
  • Re: Limit the scope of sql update
    ... You have a deep misunderstaning of the sql update. ... the FOR Clause of REPLACE. ... you can work in a scope of NEXT nRecords. ...
    (microsoft.public.fox.programmer.exchange)