Page 1 of 1

Suggestions

Posted: Mon Dec 29, 2008 9:04 pm
by ianhull
Hi all, again,

I am just looking for your opinion on this code, pros, cons, suggestions of achieving the same result with minimal code.
Would this work?

Thanks in advance.

Code: Select all

 
 
function register_organisation($keyValue){
            
            //example usage
            //$register = new registrationManager();
            //$register->register_organisation($_POST);
            
            foreach($keyValue as $key => $value){
                
                $keys. = $key.', ';
                $values. = mysql_real_escape_string($value).', ';
                
            }//end foreach
            
            mysql_query("INSERT INTO organisations ($keys) VALUES ($values)");
 
 

Re: Suggestions

Posted: Mon Dec 29, 2008 9:31 pm
by aditya2071990
I think this is the wrong place to post... better if you do it in the room called 'php-review' or something... sorry for the no-help...