|
Posted by Toby A Inkster on 04/20/07 12:37
Karl Groves wrote:
> Yes, I am getting a multidimensional array. My var_dump looks exactly
> like your second example. (and I wish it looked like the first, lol)
OK then...
function dbSelectData($query, $connection, $rtype=MYSQL_ASSOC){
$result = mysql_query($query, $connection);
if(!$result){
dbThrowError("Error in function dbSelectData. Query Was <em>$query</em>.");
return FALSE;
}
else{
$numrows = mysql_num_rows($result);
if($numrows == 0){
return FALSE;
}
elseif ($output = mysql_fetch_array($result, $rtype)){
mysql_free_result($result);
return $output;
}
else {
dbThrowError("Weird-ass error. Query Was <em>$query</em>.");
return FALSE;
}
}
}
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|