This is exactly what I need. I was trying to set this up last night with no success. I was using variables, but this wouldn't insert into my database. So I am guessing this is the correct way to get a SimpleXML object into mysql. How would I then generate this into an html table from the database? Sorry if this is a silly question, I have just really been struggling with this.
On Jan 9, 8:25 am, fastest963 <[email protected]> wrote: > Do: > ---------------------------------------------------------------------------------- > //connect to database > (code) > > $query = sprintf("INSERT INTO TABLE+NAME (`time`, `body`, `favorited`, > `name`, > `description`, `avatar`, `url`, `twitterid`) VALUES ('%s', '%s', '%s', > '%s', '%s', '%s', '%s', '%s')", > 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)); > mysql_query($query) or die(mysql_error()); > > echo "Data Inserted!"; > > mysql_close (); > ----------------------------------------------------------------------------------
