homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

having trouble updating data on submit

Msg#: 4602341 posted 7:10 am on Aug 16, 2013 (gmt 0)

i am having a little difficulty in displaying my id info on my update page. i have two entries 6 and 7 if i click update on id 6 , it will show on my update page, but when i click on submit, it wont update and also if i click update on id 7, on the address bar, it will indicate that the id =7 but it will still show id 6 infos.

here is my display code that display data on my update page

include ('config.php');
// Retrieve data from database
$sql="SELECT * FROM $tbl_name ";

secondly if i change data on my update page and click on submit the change wont reflect on my view page. and the delete function i dont even know where to start from.

//This is the directory where images will be saved
// update data in mysql database
$sql="UPDATE $tbl_name SET firstname='$firstname', lastname='$lastname', address='$address', nationality='$nationality',accountnumber='$account',accounttype='$accounttype',balance='$balance',username='$username',password='$password'
WHERE id='$id'";

header ("Location: details.php");




WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4602341 posted 9:58 pm on Aug 20, 2013 (gmt 0)

Welcome to WebmasterWorld, victorontop.

Make sure that your $_POST indexes match the form field names in your HTML. Also, you should never trust user-supplied input like that in your queries, it is a huge security issue. You need to at the very minimum escape that user-supplied data using mysql_real_escape_string() or some other method of scrubbing the input.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved