Jump to content

Uncaught PDOException: SQLSTATE[HY093]:


Recommended Posts



$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$username = $_POST["username"];
$email = $_POST["email"];

global $cn;

$sql ="INSERT INTO reg(firstname,lastname,username,email,password) VALUES(:firstname,:lastname,:username,:email,:passowrd)";

$stmt = $cn->prepare($sql);



if($run) {
  echo "Data Upload";

here is my databse code


$servername = "localhost";
$username = "root";
$password = "";

try {
$cn = new PDO("mysql:host=$servername;dbname=login",$username,$password);

} catch (PDOException $e) {
    echo "Server Offline" . $e->getMessage();



Link to comment
Share on other sites

Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\xampp\htdocs\portfilo\index.php:25 Stack trace: #0 C:\xampp\htdocs\portfilo\index.php(25): PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs\portfilo\index.php on line 25



here this error

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.