Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP script not working on local computer but works on the webserver
    primarykey
    data
    text
    <p>I am new to coding in php and also getting the environment set up on my local computer.</p> <p>Here's the current setup configuration - I have installed wamp server version 2.2 which has the following - Apache 2.4.2, php 5.4.3, mysql 5.5.24</p> <p>There is a very simple php code that i had written - </p> <pre><code>&lt;? mysql_connect("localhost","user","password"); mysql_select_db("mydbase"); $result = mysql_query("SELECT * FROM names WHERE ID LIKE '2'"); while($r=mysql_fetch_array($result)) { $id = $r["id"]; $name = $r["name"]; }//close while ?&gt; </code></pre> <p>Even a simple echo is not working. the output is blank. the same code works on the web server. It has the same user name, password and the tables were exported (from the webserver) and imported (into the local mysql). </p> <p><strong>The phpinfo() page shows the following</strong> -</p> <p>display_errors - on - on error_log - no value - no value</p> <p><strong>The php.ini file shows the following</strong> - ; display_errors ; Default Value: On ; Development Value: On ; Production Value: Off and</p> <pre><code>;error_log = php_errors.log ; Log errors to syslog (Event Log on NT, not valid in Windows 95). ;error_log = syslog error_log = c:/wamp/logs/php_error.log </code></pre> <p><strong>The error logs are empty.</strong></p> <p>When i look at the source in the browser, for the page online - it shows the output for the page on the local computer - it just shows the php code</p> <p>Could anyone please let me know what the problem could be? It seems like that there are some settings that i have messed up. But, i did not change anything - it is a regular installation and no custom settings were added.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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