Jump to content

Variables In Update Statement


Recommended Posts

Hi again,I seem to be having a problem with an update statment in my php code...Mainly, a jobID and a job description has been entered into a table called jobs like thisjobID jobDescription solution timeSpent dateOfCompletion1 bla bla I then have a form that updates the tables solution, timespent and date of completionsolution.php then executes the queries etc but there is something wrong with the highlighted update query...solution.php:

<?php//declare variables$jobID = $_POST['jobID'];$solution = $_POST['solution'];$timeSpent = $_POST['timeSpent'];// Connects to Database and MySQL$con = mysql_connect("localhost", "cranfieldL", "chelski01");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db("starlink_dfs", $con);[color="#FF0000"][b]mysql_query("UPDATE job SET solution = $solution, timeSpent=$timeSpent, dateOfCompletion = now() WHERE jobID = $jobID");[/b][/color]echo "<h1>Record added</h1>";echo "</hr>";?>  

any ideas??? need help ASAP

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...