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

8 Years
Discussion Span
Last Post by OmniX

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.