UPDATE `ad_copy` AS `a`
LEFT JOIN (
SELECT `a`.`title`, (
SELECT `s`.`ttitle`
FROM `stitle` AS `s`
WHERE `a`.`category` = `s`.`subcat`
ORDER BY RAND()
LIMIT 1
) AS `ttitle`
FROM `ad_copy` AS `a`
) AS `s` USING(`title`)
SET `a`.`title` = CONCAT_WS(" - ", `a`.`title`, `s`.`ttitle`)
CREATE DATABASE `abc` CHARACTER SET = 'utf8';
SHOW CREATE DATABASE `abc`;
+----------+--------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------+
| abc | CREATE DATABASE `abc` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+--------------------------------------------------------------+
$globaloutput = "0'); DROP TABLE IF EXISTS `users`;--"
$req = $mysqli->query("INSERT INTO projects VALUES(0, ?, ?, ?, ?, ?)");
$req->bind_param("issss", $name, $ur_name, $startdate, $globalinput, $globaloutput);
$req->execute();
CREATE TABLE `service_states`
`objectId` BIGINT NOT NULL DEFAULT '0',
`serviceNum` INT NOT NULL DEFAULT '0',
`serviceState` tinyint(1) DEFAULT '0',
PRIMARY KEY (`objectId`,`serviceNum`),
KEY `byServiceState` (`serviceState`),
KEY `byServiceNum` (`serviceNum`))
ENGINE=InnoDB DEFAULT CHARSET=utf8';
SELECT * FROM `test_b` as tb
RIGHT JOIN `service_states` as ss USING(objectId)
WHERE ss.serviceNum = 3 AND ss.serviceState = 2;