Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well first of all, I can suggest you reading about php and MySql. Second of all you have couple of issues here. The action <strong>post</strong> that performs on submit, puts everything in a form with a name tag in a superglobal <code>$_POST</code>. So you can't use this:</p> <pre><code>$database = "my_database"; $username="user"; $password="password"; $tName="customers"; </code></pre> <p>As you don't have anything there. You only have one field in your html in a form with a name tag, which is this:</p> <pre><code>&lt;input type="text" name="Name"&gt; </code></pre> <p>As I understand that this is what you are trying to achieve, to put inputs from the <code>html</code> <code>form</code> to the database.</p> <p>Now in you PHP file you can read from the superglobal <code>$_POST</code>, like this:</p> <pre><code>$username=$_POST['Name']; //Notice that the `name=` here, is the exact name in your `html` input field </code></pre> <p>You can actually see what's inside <code>$_POST</code> by var dumping it: <code>var_dump($_POST);</code> </p> <p>This is a start. See that everything is working and you getting all the relevant information from the <code>form</code> and then you can move to work on sending it to database.<br> Now for the database. You should not use <code>mysql</code> command instead use <code>PDO</code> or <code>Mysqli</code>. You can find more info here on how to connect to database using <code>PDO</code>: </p> <blockquote> <p><a href="http://net.tutsplus.com/tutorials/php/php-database-access-are-you-doing-it-correctly/" rel="nofollow">http://net.tutsplus.com/tutorials/php/php-database-access-are-you-doing-it-correctly/</a> and of course you can read the <code>PHP</code>: manual: <a href="http://www.php.net/manual/en/intro.mysql.php" rel="nofollow">http://www.php.net/manual/en/intro.mysql.php</a></p> </blockquote>
 

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