Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Execute SQL statement?


jasone

Recommended Posts

Posted

Hi!

 

I know how to modify phpcode =D But I don?t know how to execute a SQL statement...

 

Anyone with a tip how to execute this SQL statement:

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Quicksearch searches in description', 'QUICKSEARCH_IN_DESCRIPTION', 'false', 'If set to TRUE the customer can search in descriptions otherwise the search is limited to the product title', 1, 113, '2004-06-10 16:54:12', '2004-06-10 16:42:11', NULL, 'tep_cfg_select_option(array('true', 'false'),');

 

This is needed for a contribution I plan on using...

 

Thx!

Posted
Hi!

 

I know how to modify phpcode =D But I don?t know how to execute a SQL statement...

 

Anyone with a tip how to execute this SQL statement:

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Quicksearch searches in description', 'QUICKSEARCH_IN_DESCRIPTION', 'false', 'If set to TRUE the customer can search in descriptions otherwise the search is limited to the product title', 1, 113, '2004-06-10 16:54:12', '2004-06-10 16:42:11', NULL, 'tep_cfg_select_option(array('true', 'false'),');

 

This is needed for a contribution I plan on using...

 

Thx!

 

From osCommerce you can just run the code:

 

 

tep_db_query("INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Quicksearch searches in description', 'QUICKSEARCH_IN_DESCRIPTION', 'false', 'If set to TRUE the customer can search in descriptions otherwise the search is limited to the product title', 1, 113, '2004-06-10 16:54:12', '2004-06-10 16:42:11', NULL, 'tep_cfg_select_option(array('true', 'false'),')");

 

That should execute the query against the database

osCommerce is a great piece of software with wonderful contributions.

Spend some time in the contribution area. There are a lot of gems there.

Posted
From osCommerce you can just run the code

 

Sorry if I?m lame but how do I run code in oscommerce? Somewhere in admin tool?

 

Thanks for the answer by the way!

Posted

You can use a mysql connector like phpmyadmin (free) or sqlyog (not free but my favorite).

HTH,

Robert

Posted
You can use a mysql connector like phpmyadmin (free) or sqlyog (not free but my favorite).

HTH,

Robert

 

If your just looking to run an SQL statement against the database, I would just use the mySQL command line prompt. It should be located in the bin directory of your mySQL install.

osCommerce is a great piece of software with wonderful contributions.

Spend some time in the contribution area. There are a lot of gems there.

Posted
You can use a mysql connector like phpmyadmin (free) or sqlyog (not free but my favorite).

HTH,

Robert

 

Hehe, I'm replying to my own post. phpMyAdmin and sqlyog are third party applications (software) that allow you to modify mySQL databases.

The first is free and likely included with your hosting package. The second reminds me a lot of Micro$oft's Query Analyser.

 

HTH a little more,

Robert

Posted
Hehe, I'm replying to my own post.  phpMyAdmin and sqlyog are third party applications (software) that allow you to modify mySQL databases.

The first is free and likely included with your hosting package.  The second reminds me a lot of Micro$oft's Query Analyser.

 

HTH a little more,

Robert

 

Thanks man!

 

I?ve just tried phpadmin... Did not work but I wont give up! Do you know wich database I should update? Ive tried mysql, oscommerce and central_user_db...

 

Im trying this contribution by the way:

http://www.oscommerce.com/community/contri...ch,search+words

 

I need to have the possibility to search for products using the products info page...

Posted
Sorry if I?m lame but how do I run code in oscommerce? Somewhere in admin tool?

 

Thanks for the answer by the way!

 

 

Q&D:

you create a file named quick_and_dirty.php

 

the contents of the file looks something like:

<?php

echo "going to run some code<br>";
the_php_code_you_want_to_run();
echo "ok, the code ran";

/* if you want to call tep_xxx() function make sure to "require" the appropriate file */

?>

 

you upload the file to your admin/ directory.

you point your browser to the file:

 

http://your.domain.org/catalog/admin/quick_and_dirty.php

 

it is advised to put the file in your admin directory and not elsewhere, 'cause i assume your admin directory is secured.

 

also, note that there are no links to this file: you have to point at it directly.

 

hope it helps,

arod.

Posted
Do you know wich database I should update?  Ive tried mysql, oscommerce and central_user_db...

 

Look in your catalog/includes/configure.php file for your database info.

Slide down to the bottom, and you'll find something like the following:

define('DB_SERVER', 'YourDatabaseServerName'); // eg, localhost - should not be empty for productive servers
define('DB_SERVER_USERNAME', 'YourDatabaseUserName');
define('DB_SERVER_PASSWORD', 'YourDatabasePassword');
define('DB_DATABASE', 'TheDatabaseName');

 

Obviously, in the example above TheDatabaseName is the name of the database.

Let us know if you need further info,

Robert

Posted
Hehe, I'm replying to my own post.  phpMyAdmin and sqlyog are third party applications (software) that allow you to modify mySQL databases.

The first is free and likely included with your hosting package.  The second reminds me a lot of Micro$oft's Query Analyser.

 

HTH a little more,

Robert

 

There is now a free version of SQLyog. Limited features, but still pretty powerful.

 

Live long and prosper, lol. :thumbsup:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...