php-sql-query-builder icon indicating copy to clipboard operation
php-sql-query-builder copied to clipboard

Information Request - Using MySqlBuilder with mysqli

Open evanirla opened this issue 7 years ago • 2 comments

Hi there,

When building a select() query with a where() and an equals() call, when I write the query it looks like "select * from user where user.id = :var1". Am I able to change the ":var1" to the actual value I passed in? getValues() returns an empty array().

Thanks for your help!

evanirla avatar Aug 12 '17 22:08 evanirla

Similar problem here. It would be nice to add support for mysqli (question marks instead of labeled parameters). Temporary BUT NOT RECOMMENDED solution is:

$stringQuery = $builder->write($q);
$stringQuery = preg_replace('/\:v\d+/', '?', $stringQuery);

zuffik avatar Aug 29 '17 13:08 zuffik

yeah I agree it will be it would be nice to use question marks @evanirla @zuffik

marcus-hiles avatar Mar 29 '19 11:03 marcus-hiles