Extends Class PHP + MySQL

Hi,
I need help about php classes:

I have this class:
 -- http://www.phpclasses.org/package/5165-PHP-MySQL-database-access-wrapper.html

And i'm create two more classes.

<?php
class SEO {
	
	var $SEO_motor;
	var $SEO_paginas; 
	
	public function SEO($SEO_motor = "google.com", $SEO_paginas = 5) {
		if($SEO_motor == "google.co.uk")
                      return true;
	}
?>
<?php
class NJM {
	
	public function test() {
           return true;
	}
?>

Open in new window

i  need in this two classes the mysql function are available?
I user extends but not work..

Thanks!
nicojmbAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lukasz ChmielewskiCommented:
Can you show how do you use your extension ?
0
nicojmbAuthor Commented:
I've uploaded the classes.

and in the index.php i have this:
<?php
# Classes
require_once($_SERVER['DOCUMENT_ROOT'].'/recursos/class/itools.class.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/recursos/class/mysql.class.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/recursos/class/seo.class.php');
?>
<?php
$itools			=	new Itools();
$itools->MySQL	=	new MySQL	('host', 'user', 'pass', 'db');
$itools->SEO	        =	new SEO		('google.co.uk', 10);
?>
<?php
$itools->SEO->SEO_add('balearicgolf.com','golf Mallorca');
$itools->SEO->SEO_add('balearicgolf.com','golf in Mallorca');
$itools->SEO->SEO_add('balearicgolf.com','Mallorca Golf');
$itools->SEO->SEO_add('balearicgolf.com','green fees Mallorca');
$itools->SEO->SEO_add('balearicgolf.com','golf Majorca');
$itools->SEO->SEO_add('balearicgolf.com','golf in Majorca');
?>
<?php
$itools->SEO->SEO_consultar();
?>

Open in new window


And i nedd for example in the seo class that the mysql function words to add data into db.

Thanks!
itools.class.php
mysql.class.php
seo.class.php
0
Lukasz ChmielewskiCommented:
You need to extend the class with database functions, i.e.

class SEO extends MySQL{
...
}

then, after creating new object of SEO class, you'll be ablo tu use mysql functions, like:
$SEO->affected_rows();
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

nicojmbAuthor Commented:
Ok, but if i need other class with mysql functions and SEO funcions?
how i exends this??
0
Lukasz ChmielewskiCommented:
0
nicojmbAuthor Commented:
OK, that's works fine.

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.