Today I spent some time to figure out a ‘user variable’ for substituting a php variable in queries done through the database console in Php Storm

 

select name from users where id = $id

 

After searching i figured out the correct one for the same which is

 

(?<=\W|\A)\$(\d+|[a-zA-Z_](?:\w|\.)*)\$?(?=\W|\z)

 

 

 

PhpStorm Database Console user variable for substituting php variable

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.