codeigniter - How can I get a null field from the Twitter API to play nice with my database? -


Forgive me if I have any basic error, I imagine I'm missing something. I'm looking to store Twitter updates in a database with only a few areas: an auto-index index, time posted, actual status updates & amp; User ID is the answer to the update.

I'm just storing this final field so that I can provide a method of filtering the answer.

But it appears that my SQL code is throwing an error In this written form, SQL has correctly inserted two most recent updates, both of which are the answers to another user and, therefore, , In_reply_to_user_id field has data. But on the third update, which is not in response to anybody, I get the following error:

Error number: 1064

There is an error in your SQL syntax;

Update (time, position, postid, answer) value (1260070319, 'I think the manual for the right syntax is to use nearby that matches your MySQL server version) Johnny Cash knows what he was talking about the song "A Boy Named Suh". That man is both fast fast and mean. ',' 6389320556 ',)

Twitter's API does not say a default value for this parameter I tried the same query with the "Favorite" parameter, and it's in my database Each line is labeled properly with "row" so I agree with my problem that with inserting an empty string.

This is my codeigner method:

  function insert_tweet ($ tweet) {foreach ($ T $$ t) {$ when = strtotime ($ T-& gt; created_at); $ Position = $ t-> Text; $ Postid = $ t- & gt; Id; $ Answer = $ t-> In_reply_to_user_id; $ Sql ​​= 'Enter in update (time, position, postid, answer) value (?,?,?,?)'; $ This- & gt; Db- & gt; Query ($ sql, array ($ when, $ position, $ postid, $ answer)); }}  

Any help you can give will be great! I hope I have provided enough information!

More info : I should also keep in mind that the codeigner is throwing the following error:

encountered a PHP error

Seriousness: 4096

Message: The object of the class stdClass can not be converted to string

file name: database / db_r.d.app

Line number: 598

In a closed spot, it proves to be any type of CI detection scarcity.

I do not have php, but in the asp.net style pseudo code I will do this ...

  $ this-> Db- & gt; Query ($ sql, array ($ when, $ position, $ postid, string. Isolualactic ($ answer)? Null: $ answer));  

Hopefully you can customize, just need to deal with empty parameters.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -