alright, I have a method inside of a class that looks as follows:
function results($sql)
{
switch($this->config_sql_type) {
case 'mysql':
$query = mysql_fetch_array($sql) or die( mysql_error());
return $query;
break;
case 'mysqli':
$query = mysqli_fetch_array($sql);
return $query;
break;
}
}
Ok in another script, the file is called containing it.
The statement causing the trouble is this:
$sql = "SELECT * FROM d_config";
$config_query = $dbs->query($sql);
while( $row = $dbs->results($config_query) )
{
$config_name = $row["name"];
$config[$config_name] = $row["value"];
}
Everything works great, all array values assigned and such. However its like the script just stops, no errors, no timeouts, nothing, it won't do anything beyond that point unless I use the default function, rather then the method I created earlier.
while( $row = mysql_fetch_array($config_query) )
{
$config_name = $row["name"];
$config[$config_name] = $row["value"];
}
The above works, but I don't really want to "hardcode" the query. I can even type gibberish like this:
while( $row = $dbs->results($config_query) )
{
$config_name = $row["name"];
$config[$config_name] = $row["value"];
}
sdfghjjfgdgfsdrf!@T$#534564464
and I don't even get a parse error, though I know the arrays are being assigned because if I stick in the php function to print them out (http://php.net/print_r) it shows the values correctly. So something happens after that while loop, I know its not infinite, because the script would timeout and theres only 1 item in the database it can retrieve atm.