PX : code

makeSQLList() by Colin Viebrock
Download this code


<?php
function makeSQLList($array) {
        if (
is_Array($array)) {
                
reset($array);
                unset(
$SQL);
                while (list(,
$item)=each($array)) {
                        if (
is_String($item)) {
                                
$SQL[] = "'" addslashes($item) . "'";
                        } else {
                                
$SQL[] = $item;
                        }
                }
                
$sql "(" implode($SQL,", ") . ")";
        } else {
                
$sql false;
        }
        return 
$sql;
}
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.