Thanks for the replies Frederick and mohausa.
Frederick - the query I used is just a simple 1 for the purposes of the example. I actually want to get it all encapsulated in a function.
I have got it working now with a few tweaks.
Thanks
function getarray($q){
if(!$result = mysql_query($q)){
return mysql_error();
}
else{
$item = array();
while($item = mysql_fetch_assoc($result)){
$row = $item;
$arraycount++;
}
return $row;
return $arraycount;
}
}
$row = getarray("SELECT * FROM job");
for($i = 0;$i<=$arraycount;$i++){
echo $row['experience'];
}