Jump to content

Search the Community

Showing results for tags 'bindparam'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi All, I am new to php and I don't about following error. So I request you to give me solution for this and also please explain something about this error. Here I am working on User's profile page. I able to fetch data and displaying in profile's form, but data is not updating and I got the following error when I clicked for "Updation". " Uncaught Error: Call to a member function bindParam() on boolean in C:\xampp\htdocs\VS\components\update-profile.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\VS\components\update-profile.php on line 16 " And my code is: <?php include '../_database/database.php'; ini_set("display_errors",1); session_start(); $msg=""; $temp=(isset($_SESSION['Username']) ? $_SESSION['Username'] : ''); $id=(isset($_SESSION['Id']) ? $_SESSION['Id'] : ''); if($_SERVER["REQUEST_METHOD"] == "POST") { $username = $_POST['Username']; $email = $_POST['Email']; $employee = $_POST['EmployeeID']; $designation = $_POST['Designation']; $password = $_POST['Password']; $sql=$database->prepare("update set Username=:name,Email=:email,EmployeeID=:employee,Designation=:designation,Password=:password where Id='$id'"); $sql->bindParam(':Username',$name,PDO::PARAM_STR, 50); $sql->bindParam(':Email',$email,PDO::PARAM_STR, 50); $sql->bindParam(':EmployeeID',$employee,PDO::PARAM_INT, 11); $sql->bindParam(':Designation',$designation,PDO::PARAM_STR, 50); $sql->bindParam(':Password',$password,PDO::PARAM_STR, 50); if($sql->execute()){ echo "<font face='Verdana' size='2' color=green>You have successfully updated your profile<br></font>"; } else{ print_r($sql->errorInfo()); $msg=" <font face='Verdana' size='2' color=red>There is some problem in updating your profile. Please contact site admin<br></font>"; } } ?> If this is wrong kindly give me a solution. Thank You,
×
×
  • Create New...