-
Function in PHP
Hi All
I need to know as I can put a $var with different results in several tables.
Example:
Mysql - SELECT FROM * ORDER BY id
Result... $result
--------------------------- table 1
$result1 id-1
--------------------------- table 2
$result2 id-2
--------------------------- table 3
$result3.....
-
First of all, you cannot select from *. You can select * from table_name, but thats a different matter.
Secondly, what the hell is it you want to do? You're making about as much sense as a guinepig with a pancake on his head.
I'm guessing you want to update different tables with different rows from another table? Apart from the question why anyone would ever want to do something like that (only a retard makes more then one table for a certain data-type), its pretty simple: use
PHP Code:
while($result = mysql_fetch_assoc($query))
mysql_query("INSERT INTO table".$result['id']." (COLUMN NAMES)
VALUES ('$result[value1]', '$result[value2]')");
-
Thanks for help im now test your little guide :). Big thanks
Edit: Not working :/. I give you my files
RapidShare: 1-Click Webhosting
I need that
Lineage II : The Chaotic Chronicle
Like seed name (in db is seed_id), and seed price (seed_price)
Thanks