Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Supplied argument is not a valid MySQL result resource


livefooduk

Recommended Posts

I have managed to get the admin/default.php and catalog/default.php to conect to mysql database but i am getting this warning message

Warning: Supplied argument is not a valid MySQL result resource in /homepages/36/d69024189/htdocs/catalog/includes/functions/database.php on line 39

My ISP will not let me create a database file but instaed have provided me with one named db69767888

so I have changed the lines in both of the application_top.php files form:

define('DB_DATABASE', 'catalog'); to define('DB_DATABASE', 'db69767888');

 

So on the intial set up I have had to skip

mysqladmin create catalog

  mysql catalog < ./mysql_catalog.sql

Is this the cause of the problem and is there a solution?

Best wishes

Steve

Link to comment
Share on other sites

So on the intial set up I have had to skip
mysqladmin create catalog

  mysql catalog < ./mysql_catalog.sql

Is this the cause of the problem and is there a solution?

 

If you skip that your database is empty. No tables, no rows. When osCommerce tries to get information from the database it will get nothing back. Hence the cause of the error message.

 

Did your ISP install PHPMyAdmin? If yes you can use it to upload the sql file manually and have phpmyadmin create the tables and content.

 

You could also search the forum and find a load of references, solutions and caveats.

 

You could also use a snapshot. This has a complete install routine that you can run from your browser.

 

HTH

You can't have everything. That's why trains have difficulty crossing oceans, and hippos did not adapt to fly. -- from the OpenBSD mailinglist.

Link to comment
Share on other sites

I have created the tables. but I'm getting the same warning. Also I cannot insert anything to my database. If try to add any product or category, I got the error "AN ERROR HAS OCCURED! LAST ACTION : INSERT "

Link to comment
Share on other sites

I believe you should not add any db info in the aplication_top.php file as it already taken care on in the configure.php file.

 

If you cant run the install script then edit the:

 

admin/includes/configure.php

and

catalog/includes/configure.php

 

with your user sql name, pass, osC root path etc etc.

 

Here is a catalog/includes/configure.php example:

 

<?php

/*

 $Id: configure.php,v 1.12 2002/06/16 22:11:53 harley_vb Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

*/



// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

 define('HTTP_SERVER', 'http://www.yourshop.com'); // eg, http://localhost - should not be NULL for productive servers

 define('HTTPS_SERVER', 'https://www.yourshop.com'); // eg, https://localhost - should not be NULL for productive servers

 define('ENABLE_SSL', false); // secure webserver for checkout procedure?

 define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

 define('DIR_WS_IMAGES', 'images/');

 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

 define('DIR_WS_INCLUDES', 'includes/'); // If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), this can be a URL instead of a local pathname

 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');



 define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');

 define('DIR_FS_DOCUMENT_ROOT', '/home/virtual/site2/html'); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)

 define('DIR_FS_CATALOG', '/home/virtual/site2/html/catalog/');

 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');



// define our database connection

 define('DB_SERVER', 'localhost'); // eg, localhost - should not be NULL for productive servers

 define('DB_SERVER_USERNAME', 'mysql');

 define('DB_SERVER_PASSWORD', 'yoursqlusername');

 define('DB_DATABASE', 'db69767888');

 define('USE_PCONNECT', 'false'); // use persistent connections?

 define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

something like that

Link to comment
Share on other sites

Did your ISP install PHPMyAdmin? If yes you can use it to upload the sql file manually and have phpmyadmin create the tables and content.

No I don't think so, BUT the good news is I have installed osCommerce 2.2-CVS (or I shaould say it installed itself :D ) and IT WORKS 8)

Best wishes

Steve

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...