Jump to content

Archived

This topic is now archived and is closed to further replies.

csabi_fl

MYSQL query

Recommended Posts

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?

Share this post


Link to post
Share on other sites
[code]
<?php

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

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

?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.