title: What is wrong with this PHP/SQL code?
body: <p>So I get no SQL errors or anything with this code, which basically inserts into the table 'nametable', it inserts info1 and info2, but it isn't inserting for some reason, please let me know what is wrong, thanks!</p>
  
  <p>Code:</p>
  
  <pre><code>    &lt;html&gt;
      &lt;body&gt;
      &lt;h1&gt;Insert data&lt;/h1&gt;
      &lt;form action="insert.php" method="post"&gt;
      Username: &lt;input type="text" name="info1" /&gt;&lt;br&gt;&lt;br&gt;
      Password: &lt;input type="text" name="info2" /&gt;&lt;br&gt;&lt;br&gt;
  
      &lt;input type="submit" /&gt;
      &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
      &lt;?php
      $con = mysql_connect("my ip","induadmi_main","my pw");
      if (!$con)
        {
        die('Could not connect: ' . mysql_error());
        }
  
      mysql_select_db("induadmi_main", $con);
  
      $sql="INSERT INTO nametable (info1, info2)
      VALUES
      ('$_POST[info1]','$_POST[info2]')";
  
      if (!mysql_query($sql,$con))
        {
        die('Error: ' . mysql_error());
        }
      echo "1 record added";
  
      mysql_close($con)
      ?&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>EDIT:
  It turns out I DID have a SQL error
  Could not connect: Can't connect to MySQL server on 'my IP' (4)</p>
  
  <p>What am I supposed to put as my server? I tried my IP, my cpanel login username, my database name, nothing is working</p>
  
  <p>thanks</p>