hey,
Im stuck for a while with trying to get data using bindvalue in a table and using the same query to get ID from a other table into this table...
$query = $conection->prepare("INSERT INTO `posts`(`Titel`, `Prioriteit`, `Image`,`Samenvatting`, `Post`, `Poster`, `Datum`) VALUES (:titel, :prioriteit, :image, :samenvatting, :post, :poster, :datum)");
$query->bindValue(":titel", trim($this->titel, " "), PDO::PARAM_STR);
$query->bindValue(":prioriteit", $max+ 1, PDO::PARAM_STR);
$query->bindValue(":image", trim($this->image, " "), PDO::PARAM_STR);
$query->bindValue(":samenvatting", trim($this->samenvatting, " "), PDO::PARAM_STR);
$query->bindValue(":post", trim($this->post, " "), PDO::PARAM_STR);
$query->bindValue(":poster", $_SESSION["userId"], PDO::PARAM_STR);
$date = date('Y-m-d H:i:s');
$query->bindValue(":datum",($date) , PDO::PARAM_STR);
$query->execute();
$query3 = $conection->prepare("INSERT INTO `tags`( `Content`, `Blog_id`) SELECT ':content', posts.id AS `Blog_id` FROM `tags` INNER JOIN `posts` ON tags.Blog_id=posts.id");
$query3->bindValue(":content", trim($this->tags, " "), PDO::PARAM_STR);
$query3->execute();
im keep getting :content in the column instead of the data i gave the bindvalue, if i try Value it does work but i think the innerjoin wont work that way.. the innerjoin doesnt work anyway tho.
What im trying to get is if i use this query it should fill the content collumn and at the same time get the ID from the posts table stored in this row.
Sorry for bad english,,