[PHP] Small anoying problem.

Status
Not open for further replies.

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
I've stressed with this the entire day. Still haven't figured out why it won't work within one of my classes.. 7

Anyone know what's wrong with this function?

PHP:
public function link() {
 
         $getlink = mysql_result(mysql_query("SELECT `value` FROM cms_settings WHERE variable='cms_url'"), 0) or die(mysql_error());
         return $getlink;
 
       }

To me it looks ok, dunno about you guys though.. :(
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
It just simply won't fetch the data from the database even though there's a mysql connection, so basically tons of the links in the script doesn't work 'cause it has no value at all.

Edit:
Scratch it. I went for defining the constant "WWW". Works like a dream.
 

Dzetki

The Prodigal Son Returns
Jul 16, 2010
990
220
Even though you said nevermind, you should try echo, instead of return.
Echo shouldn't be used within a function. Ever. Plus the problem has been solved so there really weren't any need to post anything more in this thread.

I suggest mods close the thread to make sure the thread isn't bumped more :p
 
Status
Not open for further replies.

Users who are viewing this thread

Top