Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
why my edit page not work for me? it does not show the data I want to edit the data from the table and database. but it did not work on me, please guide me if any coding missing or i did not. anyone can help me? 


What I have tried:

PHP
<pre lang="PHP">


?>
Posted
Updated 25-Feb-18 16:41pm
v4

1 solution

PHP
$sql= "UPDATE register SET `user`='".$user."',`position`='".$position."',`serialnumber`='".$serialnumber."',`department`='".$department."' ,`taggingno`='".$taggingno."',`deliverydate`='".$deliverydate."',`location`='".$location."',`remarks`='".$remarks."',`assetstatus`='".$assetstatus."', `requirementtype`='".$requirementtype."' WHERE `id` = $id";

Not a solution to your question, but another problem you have.
Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens door to a vulnerability named "SQL injection", it is dangerous for your database and error prone.
A single quote in a name and your program crash. If a user input a name like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability, and the crash is the least of the problems, a malicious user input and it is promoted to SQL commands with all credentials.
SQL injection - Wikipedia[^]
SQL Injection[^]
SQL Injection Attacks by Example[^]
PHP: SQL Injection - Manual[^]
SQL Injection Prevention Cheat Sheet - OWASP[^]
 
Share this answer
 
Comments
brotha96 25-Feb-18 21:59pm    
so what can i do ?
Patrice T 25-Feb-18 22:20pm    
you have to read links in my Solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900