Greetings coders... I need your help, and am extremely grateful for those willing to take the time...I thank you.... Here is my code I am having trouble with. I hope it is clear my objective just from the code....
//Database Get Results Functions
function DBresults($query, $start, $end) {
$Conn=mysql_pconnect('localhost','user','password');
mysql_select_db('database', $Conn);
$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++) {
$output[$x++][mysql_field_name($array,$i)]=$result[mysql_field_name($array,$i)];
};
} while ($result=mysql_fetch_assoc($array));
//Return array results
return $output;
} else {
return 0;
};
};
When I can this function like this.
$data_hp[]=DBresults('SELECT * FROM table', 0, 5);
I cannot use any of the data returned? I use this little trick to by incrementing the first value in the array (i.e. $data_hp[$ct++][...]) For displaying content not included in a loop. Anyway.... Can anyone help?