I have many SQL statements in my code and I'm trying to convert to PDO as I just learned about it and I like it.
My question is, can you update just 1 or 2 fields that are in the Prepared statement or does it not work like that.
I have tables and as users go around my site, certain fields get updated, such as "lastlogin" or "my address" etc but all that is stored in one "user" table with 24+ columns.
Is it possible to use 1 PDO statement to update those fields individually or do i have to write a new PDO statement for every variation I want to update. like if I want to update the city and the state, I have to have a separate PDO for that. or if i want to do address and zipcode, a separate one for that, etc
I'm trying to decide if using prepared statements solely is worth it (because I would have to write 1000's of variations for a 50 column table row) or if I should only use prepared statements for big entries and just do it the other way (seen here) and sanitize as needed.
$sql = "DELETE FROM addresses WHERE usernumber = '$usernumber' and number = '$add_to_del'";
$result = mysqli_query($conn,$sql);