Return value from function

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I wanted to centralize connection to a MySQL database, so I created a
function that reads (eliminating extraneous)

        function connectDB() {
                $db = mysql_connect(-------);
                return $db;

In my main routine I have

        $db = connectDB();
        ----Database activity------

Problem: I get an error message at this point telling me that this isn't a
valid mysql reference. Why? I'm probably overlooking it, but I don't see a
limitation on the return value in the documentation.


Site Timeline