I want to use phpQuery for parsing DOM Elements. Here is the HTML tree that i want to import into MySQL db using a PHP recursive function.
The MySQL db that will store the tree as categories (with sub, sub, .., categories)
create table categories
(
categorie_id int(11) primary key auto_increment,
categorie_id_parent int(11) not null,
categorie_nom varchar(255) not null
)
Here is my pseudocode :
function getCategories( $pq_object, $last_generated_mysql_id )
{
// for every element of $pq_object on same lvl
{
// insert into mysql $pq_object->a->name
// and with categorie_id_parent as $last_generated_mysql_id if has parent
// going deeper for every child
getCategories( $pq_object->children(), mysql_insert_id() );
}
}
Thank you for your help