TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-05-2009, 10:04 AM   #1 (permalink)
The Wanderer
 
paulOr's Avatar
 
Join Date: Nov 2007
Location: Edinburgh
Posts: 21
Thanks: 1
paulOr is on a distinguished road
Default Funny Parse -> MySQL Insert error

Im parsing a feed, then entering the data into mysql.
When i echo $elemt->title or any of the others, it shows the correct value.

However when i insert it, its just blank....

Some help pl0x?

PHP Code:
include_once ('functions.php');
    
    
$xmlobj simplexml_load_file("http://www.colingilchrist.com/feeds/posts/default");
    
$channel $xmlobj;
    
    foreach (
$channel as $element) {
    
        
$title $element->title;
        
$content $element->content;
        
$time strtotime($element->published);
        
        echo 
$element->title;
        
        
#$check_query = mysql_query("SELECT * FROM `blog` WHERE `title` LIKE '%".$elemt->title."%'");
        #$check = mysql_num_rows($check_query);
        
        #if($check != 1) {
            
            
mysql_query("INSERT INTO `blog` (
                `user`, 
                `title`, 
                `message`, 
                `time`) VALUES(
                'Colin', 
                '"
.$element->title."', 
                '"
.$element->content."', 
                '"
.$element->published."')");
                
        
#}
    

__________________
paulOr.net
paulOr is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Error with Pagination Orc MySQL & Databases 29 11-21-2011 10:58 AM
MySQL Server error #2003(HY000): Can't connect to MySQL Server on 'localhost'(10061) Yoosha MySQL & Databases 3 06-15-2009 02:45 PM
Keep getting mySQL error No. 1064, but i can't seem to find the problem Durux MySQL & Databases 8 04-13-2008 07:51 PM
i keep getting unknown error by mysql sarmenhb Absolute Beginners 5 02-18-2008 02:28 PM
Error in connecting to MySQL via PHP EyeDentify MySQL & Databases 0 01-03-2008 01:06 PM


All times are GMT. The time now is 07:04 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design