Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I just tried to install the header tags controller and all seemed fine until I went to my admin at the end of the install and I get this error when I click anything and also there is no link to click for header tags in the left column like there should be--here is the exact error

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/mindzeye/public_html/catalog/admin/includes/functions/database.php:13) in /home/mindzeye/public_html/catalog/admin/includes/functions/database.php on line 13

 

what might I need to do? Please advise, thanx

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

My store does seem to function just fine, but the admin area is completely unusable right now...I really need help asap. I dont want to restore the backup, I want to use the contribution.

 

I have orders coming thru just fine, but I have to access them thru phpmyadmin, I can not use the admin area of my osc!!!!

 

Please help me with the above error someone!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted
find the redeclaration of the function in the php file and comment it out

here is the code from the database file, maybe you can look and see what is wrong? I have a feeling that maybe it is in application_top that may be causing trouble? Please help if you can! Thanx

<?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 (c) 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;
 }

 function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {
reset($data);
if ($action == 'insert') {
  $query = 'insert into ' . $table . ' (';
  while (list($columns, ) = each($data)) {
	$query .= $columns . ', ';
  }
  $query = substr($query, 0, -2) . ') values (';
  reset($data);
  while (list(, $value) = each($data)) {
	switch ((string)$value) {
	  case 'now()':
		$query .= 'now(), ';
		break;
	  case 'null':
		$query .= 'null, ';
		break;
	  default:
		$query .= '\'' . tep_db_input($value) . '\', ';
		break;
	}
  }
  $query = substr($query, 0, -2) . ')';
} elseif ($action == 'update') {
  $query = 'update ' . $table . ' set ';
  while (list($columns, $value) = each($data)) {
	switch ((string)$value) {
	  case 'now()':
		$query .= $columns . ' = now(), ';
		break;
	  case 'null':
		$query .= $columns .= ' = null, ';
		break;
	  default:
		$query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
		break;
	}
  }
  $query = substr($query, 0, -2) . ' where ' . $parameters;
}

return tep_db_query($query, $link);
 }

 function tep_db_fetch_array($db_query) {
return mysql_fetch_array($db_query, MYSQL_ASSOC);
 }

 function tep_db_result($result, $row, $field = '') {
return mysql_result($result, $row, $field);
 }

 function tep_db_num_rows($db_query) {
return mysql_num_rows($db_query);
 }

 function tep_db_data_seek($db_query, $row_number) {
return mysql_data_seek($db_query, $row_number);
 }

 function tep_db_insert_id() {
return mysql_insert_id();
 }

 function tep_db_free_result($db_query) {
return mysql_free_result($db_query);
 }

 function tep_db_fetch_fields($db_query) {
return mysql_fetch_field($db_query);
 }

 function tep_db_output($string) {
return htmlspecialchars($string);
 }

 function tep_db_input($string) {
return addslashes($string);
 }

 function tep_db_prepare_input($string) {
if (is_string($string)) {
  return trim(stripslashes($string));
} elseif (is_array($string)) {
  reset($string);
  while (list($key, $value) = each($string)) {
	$string[$key] = tep_db_prepare_input($value);
  }
  return $string;
} else {
  return $string;
}
 }
?>

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

anyone advise me please?

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Posted

see where it says

function tep_db_connect(

?

thats what is causing the problems. dont change anything there though.

It is probably whatever you changed that caused problems. look around for any refrence to database.php It could have been included twice by mistake

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...