What potential issues arise when trying to use PHP functions directly in queries instead of variables?

Using PHP functions directly in queries can lead to SQL injection vulnerabilities and can make the code harder to read and maintain. It is recommended to store the result of the PHP function in a variable before using it in the query to prevent these issues.

// Store the result of the PHP function in a variable before using it in the query
$variable = someFunction();
$query = "SELECT * FROM table WHERE column = '$variable'";