note 89135 rejected from function.simplexml-import-dom by danbrown

From: Date: Mon, 23 Feb 2009 21:38:12 +0000
Subject: note 89135 rejected from function.simplexml-import-dom by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151033@lists.php.net to get a copy of this message
Note Submitter: fraxman at hotmail dot com ---- I'd like to import an xml file into mysql database. Here's my code <?php include_once("connexion.php"); ?> <?php $books_xml = simplexml_load_file('bookstore.xml'); foreach ($books_xml ->book as $book) { print "Titre du livre: {$book->title} <br />\n"; print "Prix du Livre: {$book->price} <hr />\n"; mysql_query("INSERT INTO books SET book_title='".($book->title)."', book_author='".($book->author)."', book_year='".($book->year)."' AND book_price='".($book->price)."'") or die("Erreur MySQL : ".mysql_error()); } ?> I got this error Erreur MySQL : No database selected

« previous php.notes (#151033) next »