Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mysql connect


brittay94

Recommended Posts

First, I would like to say thank-you to everyone who posts, I am very new at this & this forum has been a HUGE help to me, & when I have to actually start a new topic somebody always answers me, Thanks again!!

 

 

I was adding a product when this message popped up:

 

Warning: mysql_connect(): Too many connections in /hsphere/local/home/brittay9/bt-countrycollectibles.com/admin/includes/functions/database.php on line 19

Unable to connect to database server!

 

 

This is the first half of the page in question:

 

 

<?php

/*

$Id: database.php,v 1.23 2003/06/20 00:18:30 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

if ($$link) mysql_select_db($database);

 

return $$link;

}

 

function tep_db_close($link = 'db_link') {

global $$link;

 

return mysql_close($$link);

}

 

function tep_db_error($query, $errno, $error) {

die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');

}

 

function tep_db_query($query, $link = 'db_link') {

global $$link, $logger;

 

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {

if (!is_object($logger)) $logger = new logger;

$logger->write($query, 'QUERY');

}

 

$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

 

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {

if (mysql_error()) $logger->write(mysql_error(), 'ERROR');

}

 

return $result;

 

 

 

 

 

***Can someone please tell me what I've done wrong, I have about 150 products listed, is that too many?? How many "products" or pictures if you will say, can be listed? With my hosting co. I have 2500 mb of disc space, if that helps... Thank-You in advance!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...