EDIT: fixed up the ON DUPLICATE KEY UPDATE clause (i hope)
in my code I have the following lines:
$query = "INSERT INTO DATA VALUES (" . $pcount . ", " . $name . ", " . $ucolor .">) ON DUPLICATE KEY UPDATE posts=" . $pcount;
$result = mysql_query("SELECT * FROM DATA", $conn);
while ($row = mysql_fetch_assoc($result)) {
print "<tr><td>";
print $row["posts"];
print "</td><td>";
print $row["color"];
print ">";
print $row["name"];
print "</span></td></tr>";
}
And $query literally is:
INSERT INTO DATA VALUES (7734, FROTH, <span style=\\'color:#33CC33;font-weight:bold; \\'>) ON DUPLICATE KEY UPDATE posts=7734
(Note that there is a SPACE between bold; and \'>)
But for some reason, the new values don't show up in the table or appear with a simple SELECT from the shell. Why? Do I somehow need to put quotes around the inside of the string variables? I used str_replace() to escape the apostrophies in case they were causing a problem, but it didn't do anything.
Thanks in advance!