How to edit unique field value in mysql database? if I edit it in phpmyadmin i get what i need, but if i do this from .php by form my field doesn’t edites( Whats wrong ?
here is sql code
$result = mysql_query ("UPDATE client SET Code='$Code', FirstName='$FirstName', LastName='$LastName', DateBirth='$DateBirth', Other='$Other' WHERE Code=$Code");
As I’ve already told you in my comment, your query is a nonsense, because you’re trying to update unique field
Codewith the same value it’s already inside!!If you’re trying to update customer infos, you should do:
If you need to change code, you should assign it a different value
Note that if
Codecolumn is a string, you should use'$Code'everywhere…