surfalot Posted September 29, 2006 Share Posted September 29, 2006 (edited) The purpose of this contribution is simply to upload and process a SQL script text file. I wrote this script since I have found a couple hosts that don't provide a SQL tool like phpMyAdmin. The code allows you to restrict the commands that can be processed so allow some additional script safety. This script processes the SQL script file and provides feedback if errors occur. This script should only be used in a password protected area of your site. If others get access to this script, you could have serious problems. But I guess it is just as dangerous as the file manager that is already distributed with osCommerce. Get it here Edited September 29, 2006 by surfalot Quote Link to comment Share on other sites More sharing options...
Roaddoctor Posted December 2, 2006 Share Posted December 2, 2006 Todd, I am installing your contribution. When I try to execute a sql file I am receiving an error Error: Destination not writeable. Did I miss something? Also, what would be the simplest way to disable this contribution betweeen uses? Quote -Dave Link to comment Share on other sites More sharing options...
surfalot Posted December 3, 2006 Author Share Posted December 3, 2006 Todd, I am installing your contribution. When I try to execute a sql file I am receiving an errorError: Destination not writeable. Did I miss something? Also, what would be the simplest way to disable this contribution betweeen uses? I should have thought over the upload destination for the SQL file a little better. find this setting is in /catalog/admin/run_sql.php about line 31: $attachment_upload_location = DIR_FS_ADMIN; change to: $attachment_upload_location = DIR_FS_BACKUP; then make sure the directory has write permissions. by default it is defined as: /catalog/admin/backups/ on your server. as installed, this directory should have write permissions. if it doesn't you may have to set it to 777 permissions. some FTP programs let you change permissions. FileZilla is one of them filezilla.sourceforge.net. in FileZilla, on your site, just right-click the folder and select "file attributes", check them all. to disable the file between uses, add this to the top of the file, anywhere after the comments section: exit; a couple of excellent questions to start this thread off! :thumbsup: Quote Link to comment Share on other sites More sharing options...
surfalot Posted December 3, 2006 Author Share Posted December 3, 2006 if anyone has trouble with the last item executing in the SQL file, add an extra carriage-return after the last statement. Quote Link to comment Share on other sites More sharing options...
wube62 Posted February 10, 2007 Share Posted February 10, 2007 When I installed R SQL I can see in Panel Administration>Tools>Run SQL Script , but I cant run it because "no access"(I changed string $attachment_upload_location = DIR_FS_BACKUP;). In Administrators>Groups menu there isn't "run_sql.php" item (see below) Tools backup.php banner_manager.php banner_statistics.php cache.php define_language.php file_manager.php mail.php newsletters.php server_info.php whos_online.php Perhaps problem is in "tools.php". My contrib osC included, (when I added string with Run_SQL thre isnt "Run SQL Sript" item in Tools Menu) : " 'link' => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=tools')); if ($selected_box == 'tools') { $contents[] = array('text' => tep_admin_files_boxes(FILENAME_BACKUP, BOX_TOOLS_BACKUP) . tep_admin_files_boxes(FILENAME_BANNER_MANAGER, BOX_TOOLS_BANNER_MANAGER) . tep_admin_files_boxes(FILENAME_CACHE, BOX_TOOLS_CACHE) . tep_admin_files_boxes(FILENAME_DEFINE_LANGUAGE, BOX_TOOLS_DEFINE_LANGUAGE) . tep_admin_files_boxes(FILENAME_FILE_MANAGER, BOX_TOOLS_FILE_MANAGER) . // BOC: Run SQL contribution tep_admin_files_boxes(FILENAME_RUN_SQL, BOX_TOOLS_RUN_SQL) . // EOC: Run SQL contribution tep_admin_files_boxes(FILENAME_MAIL, BOX_TOOLS_MAIL) . tep_admin_files_boxes(FILENAME_NEWSLETTERS, BOX_TOOLS_NEWSLETTER_MANAGER) . // tep_admin_files_boxes(FILENAME_SERVER_INFO, BOX_TOOLS_SERVER_INFO) . tep_admin_files_boxes(FILENAME_WHOS_ONLINE, BOX_TOOLS_WHOS_ONLINE)); } Quote Link to comment Share on other sites More sharing options...
surfalot Posted March 1, 2007 Author Share Posted March 1, 2007 When I installed R SQL I can see in Panel Administration>Tools>Run SQL Script , but I cant run it because"no access"(I changed string $attachment_upload_location = DIR_FS_BACKUP;). In Administrators>Groups menu there isn't "run_sql.php" item (see below) Tools backup.php banner_manager.php banner_statistics.php cache.php define_language.php file_manager.php mail.php newsletters.php server_info.php whos_online.php Perhaps problem is in "tools.php". My contrib osC included, (when I added string with Run_SQL thre isnt "Run SQL Sript" item in Tools Menu) : " 'link' => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=tools')); if ($selected_box == 'tools') { $contents[] = array('text' => tep_admin_files_boxes(FILENAME_BACKUP, BOX_TOOLS_BACKUP) . tep_admin_files_boxes(FILENAME_BANNER_MANAGER, BOX_TOOLS_BANNER_MANAGER) . tep_admin_files_boxes(FILENAME_CACHE, BOX_TOOLS_CACHE) . tep_admin_files_boxes(FILENAME_DEFINE_LANGUAGE, BOX_TOOLS_DEFINE_LANGUAGE) . tep_admin_files_boxes(FILENAME_FILE_MANAGER, BOX_TOOLS_FILE_MANAGER) . // BOC: Run SQL contribution tep_admin_files_boxes(FILENAME_RUN_SQL, BOX_TOOLS_RUN_SQL) . // EOC: Run SQL contribution tep_admin_files_boxes(FILENAME_MAIL, BOX_TOOLS_MAIL) . tep_admin_files_boxes(FILENAME_NEWSLETTERS, BOX_TOOLS_NEWSLETTER_MANAGER) . // tep_admin_files_boxes(FILENAME_SERVER_INFO, BOX_TOOLS_SERVER_INFO) . tep_admin_files_boxes(FILENAME_WHOS_ONLINE, BOX_TOOLS_WHOS_ONLINE)); } you need to add it to your Admin Access contribution. See that contribution for more help with that. Quote Link to comment Share on other sites More sharing options...
surfalot Posted June 12, 2007 Author Share Posted June 12, 2007 In the ZenCart version of this kind of contrib called "sqlpatch.php" there is a text field along with the file upload box. How hard would it be to add this box for paste-able sql statements :) been thinking about. next version. Quote Link to comment Share on other sites More sharing options...
orderfromchaos Posted September 25, 2008 Share Posted September 25, 2008 I installed your contrib and now I cant see right window in admin. How I did what: 1. Installed 3 files 2. Manually edited (using find and pasting after) filenames, tools, and english.php I have triple checked my copying and pasting to make sure its perfect File names changes - define('FILENAME_REVIEWS', 'reviews.php'); // BOC: Run SQL contribution define('FILENAME_RUN_SQL', 'run_sql.php'); // EOC: Run SQL contribution define('FILENAME_SERVER_INFO', 'server_info.php'); Tools changes - '<a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE) . '" class="menuBoxContentLink">' . BOX_TOOLS_DEFINE_LANGUAGE . '</a><br>' . '<a href="' . tep_href_link(FILENAME_FILE_MANAGER) . '" class="menuBoxContentLink">' . BOX_TOOLS_FILE_MANAGER . '</a><br>' . // BOC: Run SQL contribution '<a href="' . tep_href_link(FILENAME_RUN_SQL) . '" class="menuBoxContentLink">' . BOX_TOOLS_RUN_SQL . '</a><br>' . // EOC: Run SQL contribution class="menuBoxContentLink">' . BOX_TOOLS_FILE_MANAGER . '</a><br>' . '<a href="' . tep_href_link(FILENAME_MAIL) . '" class="menuBoxContentLink">' . BOX_TOOLS_MAIL . '</a><br>' . English Changes - define('BOX_TOOLS_FILE_MANAGER', 'File Manager'); // BOC: Run SQL contribution define('BOX_TOOLS_RUN_SQL', 'Run SQL Script'); // EOC: Run SQL contribution define('BOX_TOOLS_MAIL', 'Send Email'); Do you see something I am missing? What happened? Help, D Quote Link to comment Share on other sites More sharing options...
mr_absinthe Posted June 23, 2014 Share Posted June 23, 2014 @@surfalot I just did installation of the version for 2.2 and there is a Fatal error: Call to undefined function tep_draw_button on the run_sql.php page. I think it is because this function is not part of the older osCommerce version. Quote Absinthe Original Liquor Store Link to comment Share on other sites More sharing options...
surfalot Posted June 24, 2014 Author Share Posted June 24, 2014 (edited) yup buttons where for the new shop. v1.2.1 Update is old style buttons. [reboot] thanks for the heads-up Edited June 24, 2014 by surfalot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.