can anyone help me, please
Thanks in advance for looking at this. I hate pasting snippets of code and asking why doesn't this work, but I have no clue what else to do. I messed with this function for over an hour last night, and even now after putting it down, can make no headway. I cannot access mysql via commandline yet, so I'm stuck with phpMyAdmin. When I paste my UPDATE string in there, I get this message(the point of error moves with every little change I make, but it never goes away):
Error
SQL-query :
UPDATE 'stmywl' SET
'lnk'='http://www.amazon.com/exec/obidos/ASIN/0130834564/thelilypad0e-20/104-6953636-9883907',
'nme'='Core CSS Cascading StyleSheets (With CD-ROM)',
'img'='http://images.amazon.com/images/P/0130834564.01.THUMBZZZ.jpg',
'isE'='1', 'isS'='0', 'dsc'='test test', 'got'='0', 'prc'='27',
'typ'='BOOK', 'rkE'='2', 'rkS'='0' WHERE 'primary' = '1'
MySQL said:
You have an error in your SQL syntax near ''stmywl' SET
'lnk'='http://www.amazon.com/exec/obidos/ASIN/0130834564/thel' at line 1
below is my actual function:
function modifydb($l, $n, $i, $ie, $re, $is, $rs, $t, $d, $p, $g, $k)
{
$conn = mysql_connect("localhost","login","password");
mysql_select_db("stmywl",$conn);
if(!$ie)
$ie = "0";
if(!$is)
$is = "0";
if(!$g)
$g = "0";
$update = "UPDATE 'stmywl' SET 'lnk'='$l', 'nme'='$n', 'img'='$i',
'isE'='$ie', 'isS'='$is', 'dsc'='$d', 'got'='$g', 'prc'='$p',
'typ'='$t', 'rkE'='$re', 'rkS'='$rs' WHERE 'primary' = '$k'";
$dbResult = mysql_query($update);
printf("
Error
SQL-query :
UPDATE 'stmywl' SET
'lnk'='http://www.amazon.com/exec/obidos/ASIN/0130834564/thelilypad0e-20/104-6953636-9883907',
'nme'='Core CSS Cascading StyleSheets (With CD-ROM)',
'img'='http://images.amazon.com/images/P/0130834564.01.THUMBZZZ.jpg',
'isE'='1', 'isS'='0', 'dsc'='test test', 'got'='0', 'prc'='27',
'typ'='BOOK', 'rkE'='2', 'rkS'='0' WHERE 'primary' = '1'
MySQL said:
You have an error in your SQL syntax near ''stmywl' SET
'lnk'='http://www.amazon.com/exec/obidos/ASIN/0130834564/thel' at line 1
below is my actual function:
function modifydb($l, $n, $i, $ie, $re, $is, $rs, $t, $d, $p, $g, $k)
{
$conn = mysql_connect("localhost","login","password");
mysql_select_db("stmywl",$conn);
if(!$ie)
$ie = "0";
if(!$is)
$is = "0";
if(!$g)
$g = "0";
$update = "UPDATE 'stmywl' SET 'lnk'='$l', 'nme'='$n', 'img'='$i',
'isE'='$ie', 'isS'='$is', 'dsc'='$d', 'got'='$g', 'prc'='$p',
'typ'='$t', 'rkE'='$re', 'rkS'='$rs' WHERE 'primary' = '$k'";
$dbResult = mysql_query($update);
printf("
$update \n
$dbResult\n", mysql_affected_rows());
mysql_close($conn);
}
