I want to insert arabic values, so i used this syntax :
$sql = "
insert into sdka_creation (creation_time, sdka_for, creator_ip)
values ('$creation_time',N\'$name\', '$creator_ip')
";
// or N"$name"
this gives me this error :
Fatal error: Uncaught TypeError: sqlsrv_rows_affected(): Argument #1 ($stmt) must be of type resource, bool given in C:\xampp\htdocs\quran\go.php:443 Stack trace: #0 C:\xampp\htdocs\quran\go.php(443): sqlsrv_rows_affected(false) #1 {main} thrown in C:\xampp\htdocs\quran\go.php on line 443
and other time :
$fnmae = N'$name';
$sql = "
insert into sdka_creation (creation_time, sdka_for, creator_ip)
values ('$creation_time','$fname', '$creator_ip')
";
this gives me synatx error :
Syntax error: unexpected token ''$name''
how could be solved ?
Note : db type is nvarchar
summary (all of these errors) :
$sql = "
insert into sdka_creation (creation_time, sdka_for, creator_ip)
values ('$creation_time',N\'$name\', '$creator_ip')
";
and :
$fnmae = N'$name';