Jump to content

Variables In Update Statement


Doctrcid

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...