I have a site that has an update request. Example.
Table name -> myTable
Table Content -> id (AI)
name -> myName
age -> 13
image -> (no values)
birthdate -> (no values)
I put only the name and age values . In the image and date of birth, I did not put anything.
If I edit it and update, and I do not put anything in the name and at the age , I put only the values โโof image and the date of birth . The result is this. (I need this question)
Table name -> myTable
Table Content -> id (AI)
name -> myName
age -> 13
image -> myImage.jpg
birthdate -> Feb. 31, 2010
This is my code:
<? php
// mysql connect ...
// mysql select database ...
$ sql = "UPDATE myTable SET name = '". $ name. "', age = '". $ age. "', image = '". $ image. "', birthdate" '$ birthdate .. "' WHERE id = $ id ";
mysql_query ($ sql);
?>
I used this code, but the output is:
Table name -> myTable
Table Content -> id (AI)
name -> (no values)
age -> (no values)
image -> myImage.jpg
birthdate -> Feb. 31, 2010
Feel free to ask if you understand my question
Thank you
source
share