Help required with UPDATE columns [message #179539] |
Tue, 06 November 2012 12:40 |
|
Originally posted by: Dynamo
Hi,
I am experiencing problem with updating records in my table. The
following code works.
[
$query1 = ("UPDATE mytable SET drawing = 'mydrawing.pdf' WHERE id=2");
$result = mysql_query($query1) or die ("Error in query $query1" .
mysql_error());
mysql_close($connection);
]
but this does not
[
$drawing = $_POST['drawing'];
$query1 = ("UPDATE mytable SET drawing = $drawing WHERE id=2");
$result = mysql_query($query1) or die ("Error in query $query1" .
mysql_error());
mysql_close($connection);
]
The following error message appears when executing the second
[
Error in query: UPDATE mytable SET drawing=mydrawing.pdf WHERE id=2.
Unknown column 'mydrawing.pdf' in 'field list'
]
What am I doing wrong? Any help greatly appreciated.
TIA
Dynamo
|
|
|