Update left join mysql

update left join mysql UPDATE t1 LEFT JOIN t2 ON t2.id = t1.id SET t1.col1 = newvalue WHERE t2.id IS NULL mysql UPDate with enner join UPDATE T1, T2, [INNER JOIN | LEFT JOIN] T1 ON T1.C1 = T2. C1 SET T1.C2 = T2.C2,     T2.C3 = expr WHERE condition

Update left join mysql Read More

Store json in mysql

store json in mysql CREATE DATABASE IF NOT EXISTS `e_store` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; SET default_storage_engine = INNODB; CREATE TABLE `e_store`.`brands`( `id` INT UNSIGNED NOT NULL auto_increment , `name` VARCHAR(250) NOT NULL , PRIMARY KEY(`id`) ); CREATE TABLE `e_store`.`categories`( `id` INT UNSIGNED NOT NULL auto_increment , `name` VARCHAR(250) NOT NULL , PRIMARY […]

Store json in mysql Read More

Sql not null

how to check if a column is null in sql SELECT column_name FROM table_name WHERE column_name IS NULL; NOT NULL SQL By default, a column can hold NULL values. The NOT NULL constraint enforces a column to NOT accept NULL values. This enforces a field to always contain a value, which means that you cannot […]

Sql not null Read More

Sql conn

php sql connection <?php $servername = “localhost”; $username = “username”; $password = “password”; $dbname = “myDB”; // Create connection $conn= mysqli_connect($servername,$username,$password,$dbname); // Check connection if (!$conn) { die(“Connection failed: ” . mysqli_connect_error()); } echo “Connected Successfully.”; ?> sql conn Always use Prepared Statements Watch out for SQL injections!!! sql conn Always use Prepared Statements Watch […]

Sql conn Read More