bindParam -> CDbCommand failed to execute

I has tried the “TEXT” without ’ can works,

but now i using [color="#00FFFF"]bindParam[/color] to fix the ’ but came out error.

Do you guys know where is the problems?


		public function actionAdd() {

				if ($_POST)	{

							$nama = $_POST['nama'];

							$alamat = $_POST['alamat'];

							$telp = $_POST['telp'];


							$sql = "INSERT INTO pegawai (nama,alamat,telp)

										 VALUES('$nama','$alamat','$telp')";

							$connection = Yii::app()->db;

							

							$command = $connection->createCommand($sql);


							$command->bindParam(":nama",$nama,PDO::PARAM_STR);

							$command->bindParam(":alamat",$alamat,PDO::PARAM_STR);

							$command->bindParam(":telp",$telp,PDO::PARAM_STR);


							$command->execute();

							$this->redirect(array(

										'indexpegawai')

							);

				}

				$this->render('add');

		}

The error message show below :

You need to escape the apostrophe in the name ‘Fa’iz’. The way it is right now, your database thinks the name is ‘Fa’, because that’s what’s enclosed in the pair of apostrophes.

In MySQL you escape them with double apostrophes: ‘Fa’‘iz’. Don’t know about MariaDB.

btw: It is VERY good practice to write all your code in English, including your variable names.

Thanks Partick,

Well i using "Indonesian" language as my variable