> snippets they couldn't live without when working on a PHP project. IE, the
> kind of re-usable bits and pieces that make your life a lot easier.

I hate always having to write queries for inserting and updating a db.
 With this I can just name the form objects the same names as the
table fields and I'm done.

function insert($table, $fld, $val){
       $query = "INSERT INTO $table (%s) VALUES (%s)";
       $query = sprintf($query, implode(",", $fld), implode(",", $val));
       $result = mssql_query($query) or die;
}       


alex hogan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to