hello
I have tried the cleaner code the defender posted but this made no difference.
$list .= "<tr valign=\"top\"><td bgcolor=\"#DBDBDB\" class=\"tableheaders\"><b>Publication text:</b></td><td bgcolor=\"#F2F2F2\" class=\"tablecopy\">".$row['pub_text']."</td><td bgcolor='#DBDBDB' class=\"tableheaders\"><b>New publication text:</b></td><td bgcolor=\"#F2F2F2\" class='tablecopy'><textarea name=\"newtext2\" cols='60' rows='80' style=\"overflow:auto; padding-left:3px; font-family: Arial, Helvitica, sans-serif; font-size: 7pt; color:#7F7F7F; background: #FAFAFA; border-style: solid; border-width: 1px ;border-color: #999999;\"></textarea></td></tr>";
this is the code on my form (the page before the error page) have tried both $row['pub_text'] and $row["pub_text"] both result in an error.
ok moving on the next page:
if ($newtext2) {
$writetext = "<p>".ereg_replace("(\n|\r)+","<p></p>",$newtext)."</p>";
} else $writetext = $row["pub_text"];
this basically checks if a user has entered something in the field if not put writetext to the current field.
then my update query:
$sql = "update publications set heading = \"$writeheading\", subheading = \"$writesub\", date_pub = \"$writedate\",image = \"$writeimg\", image_type = \"$writeimg_type\", image_size=\"$writeimg_size\", contact_name = \"$writename\", contact_email = \"$writeemail\", contact_number = \"$writenumber\", pub_text = \"$writetext\" where heading = \"$heading\"";
$rs = mysql_query($sql,$conn) or die(mysql_errno() . mysql_error());
if ($rs) { ....
it is an unescaped " or ' that causes the error because when it gives me an error it says:
1064You have an error in your SQL syntax near 'Turbanators" And The Terrorists: War Crimes And Media Omissions
1.9 Media ' at line 1
so obviously the Media' breaks the code but dont underestand this never had this problem before?