Suggestions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Suggestions

Post 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)");
 
 
User avatar
aditya2071990
Forum Contributor
Posts: 106
Joined: Thu May 22, 2008 11:30 am
Location: Hyderabad, India
Contact:

Re: Suggestions

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