Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7976439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:54:33+00:00 2026-06-04T08:54:33+00:00

Edit: Now fixed! Thank you for your help! Sorry for the beginner questions, I’m

  • 0

Edit: Now fixed! Thank you for your help!

Sorry for the beginner questions, I’m creating a simple page to edit another page for my teams website.

This is the code I’m using, but it’s not updating the database.

Incorrect code:

mysql_query("UPDATE pages SET `pagename` = $pagename, `pagedesc` = $pagedesc, 
`agekey` = $pagekey, `pagecont` = $pagecont WHERE `pages_id` = $pages_id") or die(mysql_error());

Correct code:

mysql_query("UPDATE pages SET pagename = '$pagename', pagedesc = '$pagedesc', pagekey = '$pagekey', pagecont = '$pagecont' WHERE pages_id = $pages_id") or die(mysql_error());

Using “ did not work at all. But adding or die(mysql_error()); to my query helped. I should have thought of that first! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:54:35+00:00Added an answer on June 4, 2026 at 8:54 am

    Isn’t your mysql query should be

    mysql_query("UPDATE pages SET pagename = '$pagename', pagedesc = '$pagedesc', pagekey = '$pagekey', pagecont = '$pagecont' WHERE pages_id = $pages_id");
    

    instead of

    mysql_query("UPDATE pages SET 'pagename' = $pagename, 'pagedesc' = $pagedesc, 'pagekey' = $pagekey, 'pagecont' = $pagecont, WHERE 'pages_id' = $pages_id");
    

    You were using ‘ (Single quote) in field name. single quote is used when the data is of type varchar

    e.g. If table have field as myField02 varchar2(20), then while inserting query will be

    INSERT INTO myTable values ('myValue');
    

    If the field are not varchar then don’t use single quote

    INSERT INTO myTable values (myValue);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I have fixed all but two warnings now, so thank you all for
I have an edit page with url example.com/product/edit/11 Now if the validation is false
EDIT: There's now a doc page on this so this question is irrelevant, also
EDIT: Now a Major Motion Blog Post at http://messymatters.com/sealedbids The idea of rot13 is
edit: Now for some reason each productid is only showing up once instead of
THIRD EDIT: I now believe that this problem is due to a SOAP version
EDIT: This code now works correctly, I only left it in case someone finds
EDIT: This question is now redundant since Twitter no longer supports basic auth. I've
Edit This question has gone through a few iterations by now, so feel free
Edit (2012-04-12): Since this question was asked it is now possible (as of jQuery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.