MySql: Add information into multiple tables with one command -


i using php , mysql. want insert multiple tables 1 command. can done stored procedure or function? if so, call function php?

eg (psuedo code, don't code in mysql often):

hash %list = {"ip", "network_table"; "gateway", "network_table"; "name", "server_table");  function lookup (string $s) {     //look value of s in hash , return corresponding table      $table = $list[s]      return $table; }  function dotheinserting (hash $input) //or hash_ref? or array? {     each $key in $input{         $table = &lookup $key         insert $table ($key) values ($value)     } } 

some problems arise if have multiple "not null" columns. viable way? there better way if need go entering information multiple tables @ once?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -