Hacker News new | past | comments | ask | show | jobs | submit login

I prefer:

    $stmt = $somePDOObject->prepare("INSERT INTO folks " .
    "(name, addr, city) values (:name, :addr, :city);");
    $stmt->execute(
      array(
        ":name" => $name,
        ":addr" => $addr,
        ":city" => $city));
since it treats the statement as a function call, rather than some chunk of state that you manipulate.



Totally forgot you could do that. Way cool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: