mysql php handling no data after select -
i know how handle no data or error code 1329 after executing query.
$stmt = $this->db->prepare('select username users device_id=?'); $stmt->bind_param("s", $device_id); $flag = $stmt->execute(); $stmt->bind_result($username);
i'm expecting code come through since executes, flag true.
i suggest doing this:
$stmt = $this->db->prepare('select username users device_id=?'); $stmt->bind_param("s", $device_id); $stmt->execute(); $stmt->bind_result($username); if($stmt->fetch()) { echo "found $username"; } else { echo "did not find user"; } $stmt->close();
Comments
Post a Comment