Нашел в свободном доступе вот такую вещь http://dklab.ru/chicken/nablas/demo/placeholder/Placeholder.php
/**
* Database_Placeholder: placeholder support for most SQL interfaces.
* (C) 2005 Dmitry Koterov, http://forum.dklab.ru/users/DmitryKoterov/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* See http://www.gnu.org/copyleft/lesser.html
*
* Этот файл содержит две