Fatal error:cannot redeclare db_connect () (previously declared in D:/wamp/www/flex/new/mysql_inc.php:7) in D:/wamp/www/ flex/new/mysql_inc.php on line 20
The workaround is as follows:
1. Do you have an include or require in the source code
1. Define the connection object
Global dbconnect as new ADODB. Connection
2. Execute the connection statement
If dbconnect. State = adstateopen and not isempty (adstateopen) Then dbconnect. Close
Connect to ODBC
Dbconnect. connectionstring = "DSN = dataaliasname; uid = userid; Pwd = passwd ;"
Directly conne
MySQL (the best combination with PHP), GD support, php in LINUX (as the mainstream development language) 4RC1 passed, which is also in use in my system./***Only one hit_count field in the hit_count tableThe page_visit_record table is used to control one IP address to generate only one counter in a day.Create table page_visit_record (Visit_time datetime DEFAULT 0000-00-00 00:00:00 not null,Remote_addr char (15) not null,Visit_page char (60) not null,KEY visit_time (visit_time, visit_page ),Prima
Need MySQL (and PHP collocation of the best combination), GD support, Linux under PHP (as the current mainstream development language) 4RC1 through, which is what I do in the system is in use.
/***
Hit_count table only one field Hit_count
The Page_visit_record table is used to control an IP within one day only to produce a counter bounce
CREATE TABLE Page_visit_record (
Visit_time datetime DEFAULT 0000-00-00 00:00:00 not NULL,
Remote_addr Char (a) is not NULL,
Visit_page char () not NULL,
KEY v
()";
$ Result = @ MySQL (the best combination with PHP) _ query ($ query, $ dbconnect );
$ Has_count = @ MySQL (the best combination with PHP) _ result ($ result, 0, "tong ");
@ MySQL (the best combination with PHP) _ query ("lock tables hit_count write", $ dbconnect );
$ Query = "select * from hit_count ";
$ Result = @ MySQL (the best combination with PHP) _ query ($ query, $
development language) 3 ");
$ Query = "select count (*) as tong from page_visit_record where remote_addr = $ REMOTE_ADDR and date_format (visit_time, % Y-% m-% d) = curdate ()";
$ Result = @ MySQL (the best combination with PHP) _ query ($ query, $ dbconnect );
$ Has_count = @ MySQL (the best combination with PHP) _ result ($ result, 0, "tong ");
@ MySQL (the best combination with PHP) _ query ("lock tables hit_count write", $
/***
Hit_count table only one field Hit_count
Page_visit_record table is used to control an IP one day and only produce a counter beat
CREATE TABLE Page_visit_record (
Visit_time datetime DEFAULT ' 0000-00-00 00:00:00 ' not NULL,
Remote_addr char (not NULL),
Visit_page char (=) Not NULL,
KEY visit_time (Visit_time, Visit_page),
PRIMARY KEY (Visit_time)
);
***/
Include ("config.inc.php3");
$query = "SELECT count (*) as Tong from Page_visit_record where remote_addr= ' $REMOTE _addr ' and Date_form
Simple graphic counters require MYSQL and GD support
/***
Only one hit_count field in the hit_count table
The page_visit_record table is used to control one IP address to generate only one counter in a day.
Create table page_visit_record (
Visit_time datetime DEFAULT '2017-00-00 00:00:00 'not null,Remote_addr char (15) not null,Visit_page char (60) not null,KEY visit_time (visit_time, visit_page ),Primary key (visit_time));***/Include ("config. inc. php3 ");$ Query = "select count (*) as tong f
This article mainly describes how to use the MySQL database and GD to support simple graphic counters, I have seen the following articles from a reputable website. I believe the following articles will be helpful to many people.
Only one hit_count field in the hit_count table
The page_visit_record table is used to control one IP address to generate only one counter in a day.
Create table page_visit_record (
Visit_time datetime DEFAULT '2017-00-00 00:00:00 'not null,
Remote_addr char (1
mysql| Counter | graphic /***
Hit_count table only one field Hit_count
Page_visit_record table is used to control an IP one day and only produce a counter beat
CREATE TABLE Page_visit_record (
Visit_time datetime DEFAULT ' 0000-00-00 00:00:00 ' not NULL,
Remote_addr char (not NULL),
Visit_page char (=) Not NULL,
KEY visit_time (Visit_time, Visit_page),
PRIMARY KEY (Visit_time)
);
***/
Include ("config.inc.php3");
$query = "SELECT count (*) as Tong from Page_visit_record where remote_addr= ' $REM
In the school struggle for two weeks, currently able to achieve the function of login, registration, check the product information, by keyword query products, orders, according to the User name Inquiry order. Summer vacation to continue to make these features more friendly, but also to add shopping cart, any heavy and long way ...Let's talk about something else before we get to the point. The registration section has some changes, the user name cannot be empty, cannot be duplicated with the data
', ' PASSWORD ');DEFINE (' db_host ', ' localhost ');DEFINE (' db_name ', ' DATABASE ');$DBC = @mysql_connect (Db_host, Db_user, Db_password) OR die (' could not connect to MySQL: '. mysql_error ());
The reference to the connection file and the name of the database is in the constructor of the class. Your constructor should look similar to the following code:
function Post () {Require_once (' mysql_connect.php ');$this->table = "Informit_ajax";}
The following
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.