mysqli_prepare for queries with NO parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wisni1rr
    New Member
    • Nov 2011
    • 78

    mysqli_prepare for queries with NO parameters

    I am just learning how to write prepared mysqli statements in php. I have a question in regards to a query that does not have any user entered parameters such as:

    Code:
    SELECT *
    FROM table
    WHERE field IS NULL
    Should I use a prepared statement or the traditional mysqli_query()?

    If I use a prepared statement, do I just omit the mysqli_stmt_bin d_param() or should I set a piece of the query to a variable before the script starts?

    Thanks for taking the time to read my questions!
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Should I use a prepared statement or the traditional mysqli_query()?
    if you execute the query only once or twice, $mysqli->query() will suffice.

    Comment

    Working...