bullbreed Posted February 5, 2010 Share Posted February 5, 2010 HOw does the update statement work? I have some data that is echoed into form fields on the page from the database. I then want the user to be able to edit the data and submit it to the database. I can't get my head around the UPDATE statement. I tried this //Enter into Database $queryreg = mysql_query("UPDATE webpages SET page_name = $pagename, page_order = $pageorder, page_parent = $pageparent, page_title = $pagetitle, page_description = $pagedescription, page_keywords = $pagekeywords, page_content = $pagecontent"); echo("<font size=\"2\" color=\"#00cc00\">Your page has been updated! </font>"); }else{ echo ("<font size=\"2\" color=\"#ff0000\">Please complete <b>ALL</b> fields</font>"); } } It didnt work. Any ideas everyone. Thanks Link to comment https://forums.phpfreaks.com/topic/191069-update-statement/ Share on other sites More sharing options...
jl5501 Posted February 5, 2010 Share Posted February 5, 2010 I would imagine you would want some kind of where clause in there unless you want it to update every row in the database, and you need your values in single quotes, where they are string values. Link to comment https://forums.phpfreaks.com/topic/191069-update-statement/#findComment-1007511 Share on other sites More sharing options...
bullbreed Posted February 5, 2010 Author Share Posted February 5, 2010 Thank you very much Link to comment https://forums.phpfreaks.com/topic/191069-update-statement/#findComment-1007519 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.