Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear
CREATE TABLE unicodeTest( [name] [nvarchar](max) NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] ; CREATE PROCEDURE testUnicode ( @name NVARCHAR(max), @title NVARCHAR(max), @table NVARCHAR(max) ) AS BEGIN INSERT INTO unicodeTest (name) VALUES (@name) END; SELECT * from unicodeTest

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php use Carbon\Carbon; $setup2 = <<<SQL ALTER PROCEDURE testUnicode ( @name NVARCHAR(max), @title NVARCHAR(max), @table NVARCHAR(max) ) AS BEGIN INSERT INTO unicodeTest (name) VALUES (@name) END; SQL; $stmt = $pdo->prepare($setup2); $stmt->execute(); printf("\nCurrent PHP version: %s \n\n", phpversion()); $query = "SET NOCOUNT ON; EXEC testUnicode @name = ?, @title = ?, @table = ?"; $name = 'test'; $title = 'test'; $table = 'test'; // get DB version using PDO $stmt = $pdo->prepare($query); $stmt->bindParam(":name", $test, PDO::PARAM_STR, mb_strlen($test)); $stmt->bindParam(":title", $title, PDO::PARAM_STR, mb_strlen($title)); $stmt->bindParam(":table", $table, PDO::PARAM_STR, mb_strlen($table)); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); echo "<pre>"; print_r($row); // // Select using Laravel // $version = $db::select($query); // printf('DB version (Laravel Query Builder): %s ' . PHP_EOL, $version[0]->version);
Copy Clear