Primary Keys
I was reading along and it struck me that you were using two primaray keys. That's a no no ;) I would recomend examining your data structure, and optimizing it a tad bit more. If you liked, you could even get rid of the news_id field, and us an autoincremental field. I would advise reading
this for information on how to setup your database.
String data, right truncation
Now onto your real problem, the string error, I quickly googled and found this on a website. Some other monk will be able to varify if this is true:
What does a Link ODBC Gateway error of "String data, right truncation" mean?
This error is generated by the ODBC driver and suggests that you are trying to populate a table column which has a set maximum character limit with data that exceeds this limit. To avoid this problem, we suggest setting up your table's columns so that they have exactly the same data types as the formats of your form's fields (including size limitations).
Helpful? But wait, there's more! I did a tad bit more research on ODBC with some code I had from a while back, and found this:
$st->bind_param($i, $sql, DBI::SQL_LONGVARCHAR);
I noticed that your code was missing a DBI::SQL_LONGVARCHAR, and wanted to see what the heck in meant. So I went onto cpan, and found the pertinant information for DBD::ODBC. Here's what it says:
Note: those trying to bind variables need to remember that you should use the following syntax:
use DBI;
...
$sth->bind_param(1, $str, DBI::SQL_LONGVARCHAR);
It's possible that there are more problems, or that these aren't the only problems, but I hope this helps you in your debugging process.
Gyan Kapur
gyan.kapur@rhhllp.com