How to insert image name in database and image store in folder image with move_uploaded_file usign PDO:

this is my query:

$stmt = $db->prepare('INSERT INTO blog_posts_seo (postTitle,postSlug,image,postDesc,postCont,postDate) VALUES (:postTitle, :postSlug, $filename, :postDesc, :postCont, :postDate)') ;
                $stmt->execute(array(
                    ':postTitle' => $postTitle,
                    ':postSlug' => $postSlug,
                    '$filename' => $image,
                    ':postDesc' => $postDesc,
                    ':postCont' => $postCont,
                    ':postDate' => date('Y-m-d H:i:s')
                ));

Use :filename instead of $filename, like the other bound parameters.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.