Hello, I got message:
Fatal error: Cannot redeclare sqlconnect() (previously declared in E:\Program Files\Apache Group\Apache2\h tdocs\openemr-2.9.0\library\s ql.inc:33) in E:\program files\apache group\Apache2\h tdocs\openemr-2.9.0\library\s ql.inc on line 36
File sql.inc: - <?php
-
...
-
function sqlConnect($login,$pass,$dbase,$host,$port = '3306')
-
{
-
return $GLOBALS['dbh'] = $database->_connectionID;
-
}
-
...
-
?>
All programs use statement
include_once("$ srcdir/sql.inc");
to call function.
Help will be very much appreciated.
6 2891 Markus 6,050
Recognized Expert Expert
You're declaring the function twice; you can't do that.
Thank you Marcus for reply.
But I declared function only once.
I did search for "function sqlConnect" and got only one file: sql.inc.
No other declaration for this function.
Willlen
Markus 6,050
Recognized Expert Expert
I'm no psychic, so post the rest of the code from sql.inc
You shouldn't use the .inc extension in case your server doesn't understand it and prints it as text.
Programs are big. I post part of the code:
sql.inc - <?php
-
include_once(dirname(__FILE__) . "/sqlconf.php");
-
require_once(dirname(__FILE__) . "/adodb/adodb.inc.php");
-
-
if (!defined('ADODB_FETCH_ASSOC')) define('ADODB_FETCH_ASSOC', 2);
-
$database = NewADOConnection("mysql");
-
$database->PConnect($host, $login, $pass, $dbase);
-
$GLOBALS['adodb']['db'] = $database;
-
$GLOBALS['dbh'] = $database->_connectionID;
-
-
//fmg: This makes the login screen informative when no connection can be made
-
if (!$GLOBALS['dbh']) {
-
//try to be more helpful
-
if ($host == "localhost") {
-
echo "Check that mysqld is running.<p>";
-
} else {
-
echo "Check that you can ping the server '$host'.<p>";
-
}//if local
-
HelpfulDie("Could not connect to server!", mysql_error($GLOBALS['dbh']));
-
exit;
-
}//if no connection
-
-
function sqlConnect($login,$pass,$dbase,$host,$port = '3306')
-
{
-
return $GLOBALS['dbh'] = $database->_connectionID;
-
}
-
-
function sqlStatement($statement)
-
{
-
//----------run a mysql query, return the handle
-
$query = mysql_query($statement, $GLOBALS['dbh']) or
-
HelpfulDie("query failed: $statement", mysql_error($GLOBALS['dbh']));
-
return $query;
-
}
-
-
function idSqlStatement($statement)
-
{
-
return sqlInsert($statement);
-
}
-
-
function sqlClose()
-
{
-
//----------Close our mysql connection
-
$closed = mysql_close($GLOBALS['dbh']) or
-
HelpfulDie("could not disconnect from mysql server link", mysql_error($GLOBALS['dbh']));
-
return $closed;
-
}
-
-
function sqlInsert($statement)
-
{
-
//----------run a mysql insert, return the last id generated
-
mysql_query($statement, $GLOBALS['dbh']) or
-
HelpfulDie("insert failed: $statement", mysql_error($GLOBALS['dbh']));
-
return mysql_insert_id($GLOBALS['dbh']);
-
}
-
-
function sqlInsertClean($statement)
-
{
-
return sqlInsert($statement);
-
}
-
-
Further are many other functions like above...
-
-
?>
-
-
Incuding program is login.php:
-
<?php
-
-
$ignoreAuth=true;
-
include_once("../globals.php");
-
include_once("$srcdir/md5.js");
-
include_once("$srcdir/sql.inc");
-
?>
-
-
<html>
-
<head>
-
<?php html_header_show(); ?>
-
<link rel=stylesheet href="<?php echo $css_header;?>" type="text/css">
-
-
<script language='JavaScript'>
-
-
function imsubmitted() {
-
<?php if (!empty($GLOBALS['restore_sessions'])) { ?>
-
// Delete the session cookie by setting its expiration date in the past.
-
// This forces the server to create a new session ID.
-
var olddate = new Date();
-
olddate.setFullYear(olddate.getFullYear() - 1);
-
document.cookie = '<?php echo session_name() . '=' . session_id() ?>; path=/; expires=' + olddate.toGMTString();
-
<?php } ?>
-
return true;
-
}
-
-
</script>
-
-
</head>
-
<body <?php echo $login_body_line;?> onload="javascript:document.login_form.authUser.focus();" >
-
-
<span class="text"></span>
-
-
<center>
-
-
<form method="POST" action="../main/main_screen.php?auth=login" target="_top"
-
name="login_form" onsubmit="return imsubmitted();">
-
-
<?php
-
$res = sqlStatement("select distinct name from groups");
-
for ($iter = 0;$row = sqlFetchArray($res);$iter++)
-
$result[$iter] = $row;
-
if (count($result) == 1) {
-
$resvalue = $result[0]{"name"};
-
echo "<input type='hidden' name='authProvider' value='$resvalue' />\n";
-
}
-
?>
Further is going a code for entering and transfer login and password ...
It may sound silly but when you search for another instance of your method is case sensitive turned on? Or try a less exclusive search such as "sqlconnect " (note the all lower) while you will get more results than you think that you want you may just find your problem.
Just thinking out loud since the only way you should be receiving this error is if you declare this function twice. Since PHP is a non case sensitive language another function that is capitalized differently may be causing this issue.
Atli 5,058
Recognized Expert Expert
Hi.
On line 72 of your "sql.inc" file you include a file called "sql.inc"
Is this the same file?
If so, then this would cause the error you are seeing.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
Hello,
I have a very simple problem but cannot seem to figure it out. I have a
very simple php script that sends a test email to myself. When I debug
it in PHP designer, it works with no problems, I get the test email. If
|
by: Kimmo Laine |
last post by:
I'm flipping my wig here, people. I'm using classes and making each class a
file. when I'm including dependet classess, I use require_once to avoid
multiple declarations - yet they happen. I put debug_print_backtrace in the
file to see how it is included, and here's the output:
#0 require_once() called at
#1 require_once(\eKirje.textGrid.class.php) called at
#0 require_once() called at
#1 require_once(\eKirje.kanava.class.php)...
|
by: Christophe |
last post by:
class A {}
class B {}
interface MyInterface
{
void method(A a);
void method(B b);
}
|
by: Midgard |
last post by:
I have this error:
Fatal error: Cannot redeclare send_welcome_mail() (previously declared in /home/oxxowhol/public_html/config.php:21) in /home/oxxowhol/public_html/config.php on line 21
Why?
|
by: Ciegalo |
last post by:
Hi to all,
I'm getting my hands into PEAR for a small newsletter-sending project.
I need to boost the performance of the sending script and came accross
this mail_queue class that should queue the emails.
After sweating over the pear installation on myWindows Machine (IIS,
PHP 4.4.6, MySQL), I cannot even run the tutorial script.. I get :
Fatal error: Cannot redeclare class
mail_queue_container:mail_queue_container_db in...
| |
by: mrityunjay11 |
last post by:
my ccode goes as such
this is php_dbi.php
<?
function dbi_connect ( $host, $login, $password, $database ) {
if ( strcmp ( $GLOBALS, "mysql" ) == 0 ) {
$c = mysql_pconnect ( "192.168.100.3", $login, $password );
if ( $c ) {
if ( ! mysql_select_db ( $database ) )
|
by: srilathaapi |
last post by:
Hi All,
I am getting the error cannot redeclare the class some xxx in
file xxx.php.
bcz i m including xxx.php in 3 diffrent functions in the same file to
invoke the 3 differnet functions in the xxx.php from 3 different
functions.so can u give me the solution.
Thanks®ards
Sri
|
by: srilathaapi |
last post by:
Hi All,
I am getting the error cannot redeclare the class some xxx in
file xxx.php.
bcz i m including xxx.php in 3 diffrent functions in the same file to
invoke the 3 differnet functions in the xxx.php from 3 different
functions.so can u give me the solution.
Thanks®ards
Sri
|
by: Just Another Victim of the Ambient Morality |
last post by:
I have a peculiar bug in my PHP code. It looks something like this:
Fatal error: Cannot redeclare func_name() (previously declared in
script.php:57) in script.php on line 57
I've done a search and determined that "func_name" really is unique.
Besides, how is this even possible? It was previously declared on the
same line it's declared?
Any help is appreciated. Thank you!
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |