nilportugues / php-sql-query-builder

An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation.
http://nilportugues.com
MIT License
418 stars 114 forks source link

Information Request - Using MySqlBuilder with mysqli #87

Open evanirla opened 7 years ago

evanirla commented 7 years ago

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!

zuffik commented 7 years ago

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);
marcus-hiles commented 5 years ago

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