Chad,
Thanks for the reply.
I understand the basics of the INSERT INTO mysql_query, but I was
asking how specifically I get the XML values inserted.
I think I figured it out somewhat though, but I'm still getting
errors.
----------------------------------------------------------------------------------
//connect to database
(code)
//send data to database
mysql_query("INSERT INTO TABLE+NAME (time, body, favorited, name,
description, avatar, url, twitterid)
VALUES ('".$xml->status->created_at."', '".$xml->status->text."', '".
$xml->status->favorited."', '".$xml->status->user->name."', '".$xml-
>status->user->description."', '".$xml->status->user-
>profile_image_url."', '".$xml->status->user->url."', '".$xml->status-
>id."')",
mysql_real_escape_string($xml->status->created_at),
mysql_real_escape_string($xml->status->text),
mysql_real_escape_string($xml->status->favorited),
mysql_real_escape_string($xml->status->user->name),
mysql_real_escape_string($xml->status->user->description),
mysql_real_escape_string($xml->status->user->profile_image_url),
mysql_real_escape_string($xml->status->user->url),
mysql_real_escape_string($xml->status->id))
or die(mysql_error());
echo "Data Inserted!";
mysql_close ();
----------------------------------------------------------------------------------
This returns:
----------------------------------------------------------------------------------
Warning: Wrong parameter count for mysql_query() in /filepath/
filename.php on line 58
----------------------------------------------------------------------------------
Line 58 is the one that reads:
----------------------------------------------------------------------------------
mysql_real_escape_string($xml->status->id))
----------------------------------------------------------------------------------
Any ideas?
Thanks
--Alex
On Jan 8, 10:15 am, "Chad Etzel" <
jazzyc...@gmail.com> wrote:
> (1) You'll need to use something like mysql_query(...) to insert the
> data (seehttp://
www.tizag.com/mysqlTutorial/mysqlinsert.phpfor info,
> or google around about it)
>
> (2) If you're on a unix/linux system, use a cron job (seehttp://
www.aota.net/Script_Installation_Tips/cronhelp.php3or use
> google)
>
> If you're on windows, you could probably create some sort of Scheduled
> Task to call your script every so often.
>
> As for the frequency.... I guess that depends on how "old" you are
> willing to let your data get before pulling new data. 5 minutes? 10
> minutes? 2 hours? It's an authenticated request, so you are limited
> (currently) to 100 per hour, so choose accordingly.
>
> -Chad
>
> On Thu, Jan 8, 2009 at 2:28 AM,
thegreatbund...@gmail.com