Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php select using prepared statements

$sql = "SELECT * FROM users WHERE id=?"; // SQL with parameters
$stmt = $conn->prepare($sql); 
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result(); // get the mysqli result
$user = $result->fetch_assoc(); // fetch data
Source by phpdelusions.net #
 
PREVIOUS NEXT
Tagged: #php #select #prepared #statements
ADD COMMENT
Topic
Name
6+8 =