Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem. why do I get this error. others are running but last 2 is not.
First is working but last is not working.
I did ctrl+c and ctrl+v.


PHP
<pre>if(isset($_POST['apiayarkaydet'])){
	$apiayarkaydet		=$db->prepare("UPDATE ayar SET 
	ayar_recapctha		=:recapctha,
	ayar_googlemap		=:googlemap,
	ayar_analystic		=:analystic
	WHERE ayar_id=0");
	
$apiupdate 		= $apiayarkaydet->execute(array(
'recapctha' 	=> $_POST['ayar_recapctha'],
'googlemap'		=> $_POST['ayar_googlemap'],
'analystic'		=> $_POST['ayar_analystic']
)
	);
	if($apiupdate)	{header("Location:../production/apiayar.php?durum=ok");}
	else		{header("Location:../production/apiayar.php?durum=no");}
}	
if(isset($_POST['sosyalmedyaayarkaydet'])){
	$sosyalmedyaayarkaydet=$db->prepare("UPDATE ayar SET 
	ayar_facebook		=:facebook,
	ayar_youtube		=:youtube,
	ayar_twitter		=:twitter,
	ayar_google        	=:google
	
	WHERE ayar_id=0");
	
$sosyalmedyaayarupdate = $sosyalmedyaayarkaydet->execute(array(
'facebook' 			=> $_POST['ayar_facebook'],
'youtube'			=> $_POST['ayar_youtube'],
'twitter'			=> $_POST['ayar_twitter'],
'google'			=> $_POST['ayar_google']
)
	);
	if($sosyalmedyaayarupdate){header("Location:../production/sosyalmedyaayar.php?durum=ok");}
	else{header("Location:../production/sosyalmedyaayar.php?durum=no");}
}	


L

What I have tried:

I did write without copy paste and so many things.
Posted
Updated 19-Aug-19 15:53pm
Comments
Bryian Tan 12-Jul-19 22:21pm    
What is "this" error?

1 solution

You need to declared first for :facebook things
create your function if using class like
public function bind($param, $value, $type = null){
        if (is_null($type)) {
            switch (true) {
                case is_int($value):
                    $type = PDO::PARAM_INT;
                    break;
                case is_bool($value):
                    $type = PDO::PARAM_BOOL;
                    break;
                case is_null($value):
                    $type = PDO::PARAM_NULL;
                    break;
                default:
                    $type = PDO::PARAM_STR;
            }
        }
        return $this->stmt->bindValue($param, $value, $type);
    }

then
$sosyalmedyaayarkaydet=$db->prepare("UPDATE ayar SET 
	ayar_facebook		=:facebook,
	ayar_youtube		=:youtube,
	ayar_twitter		=:twitter,
	ayar_google        	=:google
	
	WHERE ayar_id=0");
       $sosyalmedyaayarkaydet->bind(':facebook', $_POST['ayar_facebook']);
       $sosyalmedyaayarkaydet->bind(':youtube', $_POST['ayar_youtube']);
       $sosyalmedyaayarkaydet->bind(':twitter', $_POST['ayar_twitter']);
       $sosyalmedyaayarkaydet->bind(':google', $_POST['ayar_google']);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900