| 
	
 | 
 Posted by Jon on 01/23/06 22:02 
On 2006-01-22 21:50:34 -0600, "Tony Marston" <tony@NOSPAM.demon.co.uk> said: 
 
>  
> "ming" <myhusky@gmail.com> wrote in message  
> news:vEWAf.9838$43.6013@nnrp.ca.mci.com!nnrp1.uunet.ca... 
>> I think it the -> problem. php5 class is different with php4 class 
>  
> No, this works in both PHP 4 and 5 as I use it all the time. 
>  
>> Jon wrote: 
>>> function query($query, $return = false) 
>>> { 
>>> $fetch = mysql_query($query, $this->connection) or  
>>> die2(mysql_error($this->connection)); 
>>> if($return) 
>>> return $fetch; 
>>> } 
>>>  
>>> mysql_error(): supplied argument is not a valid MySQL-Link resource 
>>>  
>>> the line that begins with $fetch is my problem. This was originally a  
>>> PHP5 script that I am retrofitting. 
>>> The $query is used all over, and it is really gumming things up. 
>  
> Ths function can only be used in an object as $this->connection refers  
> to a property called $connection within the current object. Have you  
> checked to see if $this->connection actually refers to a valid  
> resource? Where did the previous call to mysql_connect() store its  
> result? 
 
 
function constructor($host, $user, $pass, $database) 
 { 
  
    $this->connection = mysql_connect($host, $user, $pass) or die2 
 
This was modified from a more PHP5 compatible __constructor, and  
function cnstructor allowed it to "work" apparently, but not as well as  
I need it to. 
 
jon
 
  
Navigation:
[Reply to this message] 
 |