Function in PHP

Results 1 to 3 of 3
  1. #1
    Elite Member Bretonnian is offline
    Member +Rank
    Mar 2006 Join Date
    En tu casa con tu noviaLocation
    170Posts

    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.....


  2. #2
    Grand Master FragFrog is offline
    Grand MasterRank
    Aug 2004 Join Date
    The NetherlandsLocation
    5,629Posts
    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]')"); 
    Last edited by FragFrog; 12-11-06 at 11:46 AM.

  3. #3
    Elite Member Bretonnian is offline
    Member +Rank
    Mar 2006 Join Date
    En tu casa con tu noviaLocation
    170Posts
    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
    Last edited by Bretonnian; 13-11-06 at 01:30 AM.



Advertisement