Jump to content


Photo

MYSQL query


  • Please log in to reply
1 reply to this topic

#1 csabi_fl

csabi_fl
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 27 October 2006 - 07:14 PM

Hi.
Here is my question.After running an SQL query on one of my tables in my database ,am I able to save the result of this query in another table?If so,how?

#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 27 October 2006 - 09:42 PM

<?php

$sql = "INSERT INTO table1 (id, item, quantity) SELECT id, item, quantity FROM table2 WHERE description='apples'";

$result = mysql_query($sql, $dbconnection);

?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users