Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First please run</p> <pre><code>&lt;?php echo 'phpversion: ', phpversion(), "&lt;br /&gt;\n"; if ( !extension_loaded('mysql') ) { die('mysql module not available'); } echo 'mysql_get_client_info: ', mysql_get_client_info(), "&lt;br /&gt;\n"; die; </code></pre> <p>to check whether a) you can run <em>any</em> php script and b) the mysql_* functions are available.<br> Then try</p> <pre><code>&lt;?php echo "start&lt;br /&gt;\n"; error_reporting(E_ALL); ini_set('display_errors', true); flush(); $dbserver="localhost"; $username="root"; $pass="root"; $link=mysql_connect($dbserver, $username, $pass); if(!$link) { die('DB Connection Failed '.mysql_error()); } echo "connected&lt;br /&gt;\n"; if ( !mysql_select_db('dbname here', $link) ) { die('DB selection failed. '.mysql_error($link)); } echo "db selected&lt;br /&gt;\n"; $Name = mysql_real_escape_string($_POST['namei'], $link); $ID = mysql_real_escape_string($_POST['pid'], $link); $Address = mysql_real_escape_string($_POST['address'], $link); $Phone = mysql_real_escape_string($_POST['phone'], $link); $query = " INSERT INTO contact (Name,ID,Address,Phone) VALUES ('$Name', '$ID','$Address','$Phone') "; echo '&lt;pre&gt;Debug: query=', htmlentities($query), "&lt;/pre&gt;\n"; </code></pre> <p>It prints something in any case (echo/flush) and sets <a href="http://docs.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting" rel="nofollow">error_reporting</a> + <a href="http://docs.php.net/manual/en/errorfunc.configuration.php#ini.display-errors" rel="nofollow">display_errors</a> so that error messages are sent to the client (you don't want that in production, don't forget to remove those lines).<br> I also added the necessary calls to <a href="http://docs.php.net/mysql_select_db" rel="nofollow">mysql_select_db()</a> and <a href="http://docs.php.net/mysql_real_escape_string" rel="nofollow">mysql_real_escape_string()</a> (needed as soon as the script really sends the query to the mysql server).</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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