What are the potential pitfalls of copying SQL queries directly from phpMyAdmin into PHP scripts?

When copying SQL queries directly from phpMyAdmin into PHP scripts, the queries may contain formatting specific to phpMyAdmin that could cause syntax errors in your PHP code. To avoid this issue, it is recommended to manually format the SQL queries in your PHP scripts to ensure they are compatible with the PHP syntax.

<?php
// Original query copied from phpMyAdmin
$sql = "SELECT * FROM users WHERE id = 1";

// Manually format the query in PHP script
$sql = "SELECT * FROM users WHERE id = 1";

// Now you can safely use the formatted query in your PHP code
$result = mysqli_query($conn, $sql);
?>