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

  • Home
  • SEARCH
  • 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 8626089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:56:26+00:00 2026-06-12T07:56:26+00:00

Trying to update a database records when a user hits a submit button with

  • 0

Trying to update a database records when a user hits a submit button with the ID of ‘Save’ but it’s not working, here’s what I have for the MYSQL update query:

    if ($_POST['SaveCall'] ) {


// set database server access variables:
$host = "localhost";
$user = "root";
$pass = "";
$db = "TILRenewals";

// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");


// select database
mysql_select_db($db) or die ("Unable to Choose database!");







$SPKCustNo = mysql_real_escape_string($_POST['SPKSelect']);

$FName = mysql_real_escape_string($_POST['FName']);
$SName = mysql_real_escape_string($_POST['SName']);
$PostCode = mysql_real_escape_string($_POST['PostCode']);
$Product = mysql_real_escape_string($_POST['Product']);
$PaymentMethod = mysql_real_escape_string($_POST['PaaymentMethod']);
$RenewalDate = mysql_real_escape_string($_POST['Renewa;Date']);
$HomeTel = mysql_real_escape_string($_POST['HomeTel']);
$WorkTel = mysql_real_escape_string($_POST['WorkTel']);
$Priority = mysql_real_escape_string($_POST['PriorityCheckBox']);
$Call1 = mysql_real_escape_string($_POST['Call1']);
$Call1Notes = mysql_real_escape_string($_POST['Call1Notes']);

$Call2 = mysql_real_escape_string($_POST['Call2']);
$Call2Notes = mysql_real_escape_string($_POST['Call2Notes']);

$Call3 = mysql_real_escape_string($_POST['Call3']);
$Call3Notes = mysql_real_escape_string($_POST['Call3Notes']);

$Call4 = mysql_real_escape_string($_POST['Call4']);
$Call4Notes = mysql_real_escape_string($_POST['Call4Notes']);

$Call5 = mysql_real_escape_string($_POST['Call5']);
$Call5Notes = mysql_real_escape_string($_POST['Call5Notes']);

$Outcome = mysql_real_escape_string($_POST['Outcome']);


$sql="UPDATE Data
SET ForeName = '$FName', Surname='$SName', PostCode='$PostCode', Product='$Product', PaymentMethod='$PaymentMethod',RenewalDate='$RenewalDate',HomeTel='$HomeTel,WorkTel='$WorkTel',Priority='$Priority',Call1='$Call1',Call1Notes='$Call1Notes',Call2='$Call2',Call2Notes='$Call2Notes',Call3='$Call3',Call3Notes='$Call3Notes',Call4='$Call4',Call4Notes='$Call4Notes',Call5='$Call5',Call5Notes='$Call5Notes',Outcome='$Outcome'
WHERE SPKCustNo='$SPKCustNo' ";


mysql_query($sql) or die(mysql_error()); ;

}


?>

Can anyone help? Thankyou!

* Have edited the above to include the connection to the DB and sending the query, Now I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘01268510268’,Priority=’1′,Call1=’03/10/12′,Call1Notes=’Test Call 1 Notes’,Call2=’ at line 2

  • 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-12T07:56:28+00:00Added an answer on June 12, 2026 at 7:56 am

    Well, assuming that is all the code, you have. I do not see where you have connected to the database, assuming you did connect to the database. You did not execute the query.

    Once you have the sql query in $sql, perform this operation.
    mysql_query($sql);

    Edit

    You did not close the quotes near after $Hometel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to update a row in my database but it's not running. Below
I'm trying to update my database records, but no changes are made and no
I'm trying to update the records in an Access database where the column Group
I am trying to update an existing record in a database using CoreData, but
I am trying to update mysql data by letting users submit a form. The
We currently have some php code that allows an end user to update records
I'm trying to use saveAll correctly to update User records for multiple relational models.
i am trying to update my records using UPDATE in php and mysql ,
I am trying to get cakePHP to update a record in the database as
I am trying to update a database with values from a csv file, the

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.