문제

I ran the query:

  $stmt = $dbh->prepare("DELETE * FROM `1_cart_items` WHERE `forid`=?");
  $stmt->bindValue(1,$_SESSION['name'],PDO::PARAM_INT);
  $stmt->execute();

and I've appeared to delete the entire table, what have I done wrong that has caused this problem?

도움이 되었습니까?

해결책

Quite a short answer: no, your query did not cause your problem. Your query would have failed, as already said in the comments. The * will break the query, preventing it from deleting anything. Your problem must have originated somewhere else.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top