Creating php array from mysql query?

  • Thread starter Thread starter Jenny G
  • Start date Start date
J

Jenny G

Guest
I have a query in my code which returns several values from the database.

Is there any way to put these results into an array.

Here is the code:

$query1="SELECT term FROM term INNER JOIN join_table ON join_table.term_id=term.id INNER JOIN product ON join_table.product_id=product.id WHERE product = '$product1'";

$result1=mysql_query($query1) or die(mysql_error());

$row1 = mysql_fetch_array($result1);

//To display the results
while($row1 = mysql_fetch_array($result1)) {
echo $row1['term'];
}


Is there any way i can save this result into an array?
 
Back
Top