how do I show this mysql error on screen
<p>Current function to run mysql query in PHP and displays error on screen when there is one.  I am trying to make it only show the qery and error message to a user with a session $_SESSION['auto_id'] == 1 and regualr users will just see a nice message saying there is an error</p>

<p>In the second example I attempted to do it but I am not sure how to parse the code correctly inside of or die(" ")</p>

<p>Works:</p>

<pre><code>&lt;?PHP    
    function executeQuery($sql) {
        $result = mysql_query($sql) or die("&lt;span style='FONT-SIZE:11px; FONT-COLOR: #000000; font-family=tahoma;'&gt;&lt;center&gt;An Internal Error has Occured. Please report following error to error@friendproject.com&lt;br&gt;&lt;br&gt;" . $sql . "&lt;br&gt;&lt;br&gt;" . mysql_error() . "'&lt;/center&gt;&lt;/FONT&gt;");
        return $result;
    }
?&gt;
</code></pre>

<p>Doesn't Work:</p>

<pre><code>&lt;?PHP
    function executeQuery($sql) {
        $result = mysql_query($sql) or die("
        &lt;span style='FONT-SIZE:11px; FONT-COLOR: #000000; font-family=tahoma;'&gt;&lt;center&gt;An Internal Error has Occured. The error has been recorded&lt;br&gt;'&lt;/center&gt;&lt;/FONT&gt;
        if($_SESSION['auto_id'] == 1){
         echo = '&lt;br&gt;' . $sql . '&lt;br&gt;&lt;br&gt;' . mysql_error() . "
        }
        ");
?&gt;
</code></pre>
