Note that there are some explanatory texts on larger screens.

plurals
  1. POPhp error not displaying
    text
    copied!<p>I've been having significant problems attempting to link to a MySQL database using PHP. The php script just crashes without echoing any error messages. </p> <p>In order to track down the error I've whittled down the code. It crashes even for something as trivial as a simple assignment operation!</p> <p>the code </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;head&gt; &lt;title&gt; &lt;/title&gt; &lt;/head&gt; &lt;body&gt; Testing&lt;br /&gt; &lt;?php echo("hello") $hostname_testserver = "stringvar"; echo(" no1 ") ?&gt; Testing &lt;br /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Displays nada: absolutely no source code whatsoever. Blank screen, no browser error message; nothing.</p> <p>What makes this so peculiar is that I know that I have successfully managed to get php scripts working on this server... using exactly this assignment. </p> <p>So naturally something more complicated like:</p> <pre><code>&lt;?php /*** mysql hostname ***/ $hostname = 'HOST'; /*** mysql username ***/ $username = 'NAME'; /*** mysql password ***/ $password = 'PASSWORD'; try { $dbh = new PDO("mysql:host=$hostname;dbname=DATABASE", $username, $password); /*** echo a message saying we have connected ***/ echo 'Successfully connected with database&lt;br /&gt;'; /*** INSERT data ***/ $count = $dbh-&gt;exec($insertion); /*** echo the number of affected rows ***/ echo $count; catch(PDOException $e) { echo $e-&gt;getMessage(); } ?&gt; </code></pre> <p>Doesn't even get off the ground >&lt;</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload