Diego...
Thanks for your continued help.
This was not the problem...but your answer did spark some rethought... I finally got it to work. Thank you everyone for your help.
Here was the solution...I pasted the code below as well.
The first trick was in the code I had the $x++ in the array instead of outside of the array, so as it cycled through the fields, it was also incrementing the first value of the array.
The second part (i had the wrong user name and password for the database... but that didn't solve it right away either)
lastly...the way I called the function and returned the function it created an array within an array with an array.
Long story short...here is the code that works for anyone who cares... THANKS A TON FOR YOUR HELP EVERYONE!
//Database Get Results Functions
function DBresults($query, $start, $end) {
$Conn=mysql_pconnect('localhost','user','pass');
mysql_select_db('dbase', $Conn) or die (mysql_error());
$array=mysql_query(stripslashes($query) . " LIMIT " . $start . ", " . $end);
if ($array) {
$result=mysql_fetch_assoc($array);
$fields=mysql_num_fields($array);
$rows=mysql_num_rows($array);
$x=0;
$output=array();
do {
for ($i=0; $i<$fields; $i++) {
$field1=mysql_field_name($array,$i);
$var2store = $result[$field1];
$output[$x][$field1]=$var2store;
};
$x++;
} while ($result=mysql_fetch_assoc($array));
//Return array results
return $output;
} else {
return 0;
};
};
And when you want to call the function:
$query="SELECT column FROM table ORDER BY column DESC";
$data=DBresults($query, 0, 4);
Then reference the data by calling $data[$ct++]['column']
Cheers,
SOL