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?
 
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
 
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.