Okay I'm sure this is just a stupid error on my part but I've been trying for the better part of 3 hours to figure it out with no success. I've read everything I can about returning an array and nothing seems to point me in the right direction. Here's the related code:
function setSql($req_sql) {
$this->sql = $req_sql;
}
function getSql() {
return $sql;
}
function setQuery($req_query) {
$query = $req_query;
}
function getQuery() {
return $query;
}
setSql("SELECT * FROM band");
setQuery(mysql_query(getSql()));
The setSql and getSql statements are correct, I know that because before I added the setQuery function I used to just use this:
setSql("SELECT * FROM band");
$result = mysql_query(getSql());
and it worked fine. I think there is a problem with either setQuery or getQuery. The database connection is already made and it works before this code is called. Does anyone have a clue as to what might be causing this to return nothing? When it should be returning 230 values, as it did before I added the setQuery function.
Thank you!
Jared