hi, can you help me how to update record in database?
here's my code, i don't know whats wrong in my code. nothing happened every time, I want to update my records.

<?php
	mysql_query ("UPDATE from registration SET firstname ='$firstname_x', lastname ='$lastname_x', MI ='$MI_x', 

	 address ='$address_x', gender ='$gender_x', age ='$age_x', birthdate ='$birthdate_x', status ='$status',

	 contactnumber ='$contactnumber_x', occupation ='$occupation_x', nationality ='$nationality_x', 
	
		religion ='$religion_x',date ='$date_x' where patientID ='$patientID_x'"); 

	echo "<br><br>";
	echo "<div><center><strong><h1>Profile Successfully Updated</h1></center></strong></div>";
?>

hope someone could help me about it. thanks a lot

Recommended Answers

All 2 Replies

1 syntax I see right away is your query, UPDATE doesn't use FROM, it's just UPDATE table1 SET etc...

mysql_query ("UPDATE registration SET firstname ='".$firstname_x."', lastname ='".$lastname_x."', MI ='".$MI_x."',.......n");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.