>and i never see any copy.) My only guess is that a mysql_link resssource is >also an object and gets copied or lost somewhere in the middle.
In the old days, a MySQL link resource was just an integer. It is now a 'Resource' type internal to PHP. I don't *think* it will get copied on assignment... That would be pretty icky. >Can anybody tell me what i could do??? > >(PS i didn't post all the source and the real login info...tehre is too much >to paste and also, it's too improtant to reveal anything) > >SOURCE: >class mysql_connection{ > //Variables > var $mysql_link; > var $mysql_username; > var $mysql_password; > var $mysql_database; > > //Constructor(Establishes the connection) > function mysql_connection($hostname, $username, $password, $database){ > //Connection to database > $this->mysql_link = mysql_connect("$hostname", "$username", "$password"); > if(!$this->mysql_link){ > //Display an error message > exit("Error connecting to mysql server, contact web administrator or try >again later!"); > } > //Select the database > if(!mysql_select_db("$database", $this->mysql_link)){ > //Display an error message > exit("Error selecting database on mysql server, contact web administrator >or try again later!"); > } > } >} > >class arenas{ > > //System objects > var $mysql_server; > var $item; > > //Variables/Arrays > var $indexes = array(); > var $curindex = 0; > > //Constructor > function arenas(&$mysql_server){ > //Store the server > $this->mysql_server = &$mysql_server; > //Build the index > $this->refresh(); > } >} > >$mysql_server = new mysql_connection("localhost", "username", "password", >"database"); > >//Get the arenas and the current item >$arenas = new arenas($mysql_server); > >//At this point i would do a sql query from inside my arenas class that >would raise an error >//If i echo the error from inside the class using >//echo mysql_error($this->mysql_server->mysql_link); >//it works > >//if i echo from the script itself like here it doesn't work >echo mysql_error($mysql_server->mysql_link); > >//The first one will show something, the second will never show the error, >any clue why? echo out $mysql_server at various places, and $mysql_server->mysql_link and see what PHP thinks they are. -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php