php - Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number -


im having error select statment using pdo, , im not understanding reason why happening.

do see wrong here?

i'm having error:

warning: pdostatement::execute(): sqlstate[hy093]: invalid parameter number: parameter not defined in $readgallery->execute();

$delid = $_get['delid']; $thumb = $_get['thumb']; $folder = '../uploads/'; $readgallery = $pdo->prepare("select * gallery news_id = ?"); $readgallery->bindparam(':news_id', $delid); $readgallery->execute(); $numgallery =   $readgallery->rowcount(); 

change

$readgallery = $pdo->prepare("select * gallery news_id = ?"); 

to

$readgallery = $pdo->prepare("select * gallery news_id = :news_id"); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -