I have done this a million times before.
I dont understand why this is not working through the use of a class.
It is telling me that the variable is "undefined" hence contains a NULL value which is a load of *((^&$#.
Anyways my code(sections of it) is below, any help much appreciated.

private con;
$this->con = mysql_connect(server, name, pass);

Obviously the initialization statement is in a method which is called via the constructor. Now something is wrong when it plan as day that con is being given a value, I dont understand why it saying it is not. Anyways any idea where to look and how to fix much appreciated.

Thanks, Regards X

ps:

private $con;

How about adding a die statement to assist in debugging like so

$this->con=mysql_connect($server,$name,$pass) or die(mysql_error());

happy times!

I think I have figured out the problem while away from the computer.
I think it has to do using the mysql_connect within classes.
Anyone got any examples? Thanks, Regards X

PS: Ill test that when I get back to my computer, thanks.

Someone needs to create a decent php debugger! SOLVED!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.