Bulk upload in Joomla
up vote
-1
down vote
favorite
I have a excel sheet which contains more then 2k records. What I am doing is uploading the excel sheet and inserting the records in two table. First the record is inserted in my custom component table and after that a menu is created for each record. Now the problem what I am facing is inserting the 2K records which hangs up the browser and execution time exceeds and even cause the memory exhaust problem.
Any suggestion to do such thing without any error would be appreciable.
foreach($finalData as $key=>$val)
{
echo $key."<br/>";
$params = [
"service_description" => $val[7],
"contact_number" => $val[8],
"contact_email" => $val[9],
"keywords" => $val[10],
"price" => $val[11],
"banner" => $defaultBanner,
"menu-anchor_title" => "",
"menu-anchor_css" => "",
"menu_image" => "",
"menu_image_css" => "",
"menu_text" => 1,
"menu_show" => 1,
"page_title" => "",
"show_page_heading" => "",
"page_heading" => "",
"pageclass_sfx" => "",
"menu-meta_description" => $val[7],
"menu-meta_keywords" => $val[10],
"robots" => "",
"secure" => 0
];
$custom_data = [
"parent_id" => $jinput->get("parent_id"),
"level" => 2,
"menutype" => "mainmenu",
"title" => "Sameday and On Board Couriers in ".$val[2],
"type" => "component",
"link" => "index.php?option=com_couriercsv&view=courier",
"published" => 1,
"browserNav" => 0,
"access" => 1,
"template_style_id" => 0,
"params" => json_encode($params),
"home" => 0,
"language" => "*",
"client_id" => 0,
"component_id" => $component->extension_id
];
$menu = JTable::getInstance('Menu','MenusTable');
// menu if present
$menu->load(0);
$menu->setLocation($custom_data['parent_id'], 'last-child');
$menu->bind($custom_data);
$menu->store();
if($menu->id)
{
$menu->rebuildPath($menu->id);
// store the menu id
}
}
php mysql joomla
add a comment |
up vote
-1
down vote
favorite
I have a excel sheet which contains more then 2k records. What I am doing is uploading the excel sheet and inserting the records in two table. First the record is inserted in my custom component table and after that a menu is created for each record. Now the problem what I am facing is inserting the 2K records which hangs up the browser and execution time exceeds and even cause the memory exhaust problem.
Any suggestion to do such thing without any error would be appreciable.
foreach($finalData as $key=>$val)
{
echo $key."<br/>";
$params = [
"service_description" => $val[7],
"contact_number" => $val[8],
"contact_email" => $val[9],
"keywords" => $val[10],
"price" => $val[11],
"banner" => $defaultBanner,
"menu-anchor_title" => "",
"menu-anchor_css" => "",
"menu_image" => "",
"menu_image_css" => "",
"menu_text" => 1,
"menu_show" => 1,
"page_title" => "",
"show_page_heading" => "",
"page_heading" => "",
"pageclass_sfx" => "",
"menu-meta_description" => $val[7],
"menu-meta_keywords" => $val[10],
"robots" => "",
"secure" => 0
];
$custom_data = [
"parent_id" => $jinput->get("parent_id"),
"level" => 2,
"menutype" => "mainmenu",
"title" => "Sameday and On Board Couriers in ".$val[2],
"type" => "component",
"link" => "index.php?option=com_couriercsv&view=courier",
"published" => 1,
"browserNav" => 0,
"access" => 1,
"template_style_id" => 0,
"params" => json_encode($params),
"home" => 0,
"language" => "*",
"client_id" => 0,
"component_id" => $component->extension_id
];
$menu = JTable::getInstance('Menu','MenusTable');
// menu if present
$menu->load(0);
$menu->setLocation($custom_data['parent_id'], 'last-child');
$menu->bind($custom_data);
$menu->store();
if($menu->id)
{
$menu->rebuildPath($menu->id);
// store the menu id
}
}
php mysql joomla
You need to show some code. Hopefully you are using the joomla api to do the inserts. You may want to ask your question on the Joomla stack exchange site.
– Elin
Nov 23 at 2:55
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a excel sheet which contains more then 2k records. What I am doing is uploading the excel sheet and inserting the records in two table. First the record is inserted in my custom component table and after that a menu is created for each record. Now the problem what I am facing is inserting the 2K records which hangs up the browser and execution time exceeds and even cause the memory exhaust problem.
Any suggestion to do such thing without any error would be appreciable.
foreach($finalData as $key=>$val)
{
echo $key."<br/>";
$params = [
"service_description" => $val[7],
"contact_number" => $val[8],
"contact_email" => $val[9],
"keywords" => $val[10],
"price" => $val[11],
"banner" => $defaultBanner,
"menu-anchor_title" => "",
"menu-anchor_css" => "",
"menu_image" => "",
"menu_image_css" => "",
"menu_text" => 1,
"menu_show" => 1,
"page_title" => "",
"show_page_heading" => "",
"page_heading" => "",
"pageclass_sfx" => "",
"menu-meta_description" => $val[7],
"menu-meta_keywords" => $val[10],
"robots" => "",
"secure" => 0
];
$custom_data = [
"parent_id" => $jinput->get("parent_id"),
"level" => 2,
"menutype" => "mainmenu",
"title" => "Sameday and On Board Couriers in ".$val[2],
"type" => "component",
"link" => "index.php?option=com_couriercsv&view=courier",
"published" => 1,
"browserNav" => 0,
"access" => 1,
"template_style_id" => 0,
"params" => json_encode($params),
"home" => 0,
"language" => "*",
"client_id" => 0,
"component_id" => $component->extension_id
];
$menu = JTable::getInstance('Menu','MenusTable');
// menu if present
$menu->load(0);
$menu->setLocation($custom_data['parent_id'], 'last-child');
$menu->bind($custom_data);
$menu->store();
if($menu->id)
{
$menu->rebuildPath($menu->id);
// store the menu id
}
}
php mysql joomla
I have a excel sheet which contains more then 2k records. What I am doing is uploading the excel sheet and inserting the records in two table. First the record is inserted in my custom component table and after that a menu is created for each record. Now the problem what I am facing is inserting the 2K records which hangs up the browser and execution time exceeds and even cause the memory exhaust problem.
Any suggestion to do such thing without any error would be appreciable.
foreach($finalData as $key=>$val)
{
echo $key."<br/>";
$params = [
"service_description" => $val[7],
"contact_number" => $val[8],
"contact_email" => $val[9],
"keywords" => $val[10],
"price" => $val[11],
"banner" => $defaultBanner,
"menu-anchor_title" => "",
"menu-anchor_css" => "",
"menu_image" => "",
"menu_image_css" => "",
"menu_text" => 1,
"menu_show" => 1,
"page_title" => "",
"show_page_heading" => "",
"page_heading" => "",
"pageclass_sfx" => "",
"menu-meta_description" => $val[7],
"menu-meta_keywords" => $val[10],
"robots" => "",
"secure" => 0
];
$custom_data = [
"parent_id" => $jinput->get("parent_id"),
"level" => 2,
"menutype" => "mainmenu",
"title" => "Sameday and On Board Couriers in ".$val[2],
"type" => "component",
"link" => "index.php?option=com_couriercsv&view=courier",
"published" => 1,
"browserNav" => 0,
"access" => 1,
"template_style_id" => 0,
"params" => json_encode($params),
"home" => 0,
"language" => "*",
"client_id" => 0,
"component_id" => $component->extension_id
];
$menu = JTable::getInstance('Menu','MenusTable');
// menu if present
$menu->load(0);
$menu->setLocation($custom_data['parent_id'], 'last-child');
$menu->bind($custom_data);
$menu->store();
if($menu->id)
{
$menu->rebuildPath($menu->id);
// store the menu id
}
}
php mysql joomla
php mysql joomla
edited Nov 23 at 12:25
asked Nov 21 at 17:13
Manoj Thakur
366
366
You need to show some code. Hopefully you are using the joomla api to do the inserts. You may want to ask your question on the Joomla stack exchange site.
– Elin
Nov 23 at 2:55
add a comment |
You need to show some code. Hopefully you are using the joomla api to do the inserts. You may want to ask your question on the Joomla stack exchange site.
– Elin
Nov 23 at 2:55
You need to show some code. Hopefully you are using the joomla api to do the inserts. You may want to ask your question on the Joomla stack exchange site.
– Elin
Nov 23 at 2:55
You need to show some code. Hopefully you are using the joomla api to do the inserts. You may want to ask your question on the Joomla stack exchange site.
– Elin
Nov 23 at 2:55
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417365%2fbulk-upload-in-joomla%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to show some code. Hopefully you are using the joomla api to do the inserts. You may want to ask your question on the Joomla stack exchange site.
– Elin
Nov 23 at 2:55