You are here: Object question « All PHP « IT news, forums, messages
Object question

Posted by None on 08/02/05 03:51

Hello,
I know these seem simple to most but...
I created a simple connection class:

Class connDb{
public $resourse;
function Conn($host,$user,$pass){
$link = mysql_connect($host, $user, $pass);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$this->resourse=$link;
mysql_select_db("test2");

When I go to create 2 objects with the same name:
$connTest = new connDb;
$connTest->Conn('localhost','root', '');
echo $connTest->resourse;
$connTest = new connDb;
$connTest->Conn('localhost','mike', '');
echo $connTest->resourse;

I DO NOT get an error I just get 2 different resourcce IDs.Can you have two
objects with the same name?
Thanks
Mike

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация