I was getting a DB error message when I tried to create a user.
I then went to include/admin.php and added else return $cal_db->sql_error();
It now says Field 'first_name' doesn't have a default value. I only have boxes for username and password nothing for the first name. I tried the page in both IE and Firefox same issue.
When I add a event it says Unable to complete the update.
In my config I am using the root user and password for the mysql database for testing I have setup a DB called reece and all the tables are in the DB. Also mysql is version 5.0.45.
Config file information
// the sql server host - this is usually "localhost" if the database server is on the same machine
define("CAL_SQL_HOST","localhost");
// the sql database user that php will log in with
define("CAL_SQL_USER","root");
// the sql database user's password
define("CAL_SQL_PASSWD","rootpw");
// this defines the connection is to a mysql database. This is the only one supported at the moment.
define("CAL_SQL_TYPE","mysql");
// this is the name of the database the calendar tables are stored in.
define("CAL_SQL_DATABASE","reece");
// this is the prefix of the database tables. If you change the names of the tables, you need to change this.
define("CAL_SQL_PREFIX","cal_");
// this is the user password salt. do not change this unless you know what you are doing!
define("CAL_SQL_PASSWD_SALT", "!saltismyfriend!");
// the root username for the system
define("CAL_ROOT_USERNAME","root");
// the default root user password (overwritten later from options table)
define("CAL_ROOT_PASSWORD","abc123");
// This adds extra path info to where it looks for the css, javascript, and language files.
// normally this is blank, but if you are loading the calendar from a file in a
// different directory, you will probalby need to this for it to find the files it needs.
define("CAL_INCLUDE_PATH","");
// This defines if the calendar is stand alone, or integrated into a website
define("CAL_STAND_ALONE", TRUE); // true or false
// only used if CAL_STAND_ALONE is true. Sets the title tags in the html header to this.
define("CAL_STAND_ALONE_TITLE","Reece PHP Calendar");
// this defines if you want to use a query designed for MySQL 5.0.0 and above or a query deisgned for MySQL 4.1.1 and above.
define("CAL_SQL_MYSQL_5", True); // Change to false if you don't have MySQL 5 yet!
Any suggestions I’m at a loss Thanks
Eric
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is a database issue. Your version of MySQL is requiring a value for the first_name column since no default is specified in the database, and my script is not specifying the first_name (havn't put that functionality there yet).
You can either add the default with something like this:
ALTER TABLE cal_users CHANGE first_name first_name VARCHAR( 50 ) NOT NULL DEFAULT ''
OR you can just drop the column since it's not used right now:
alter table cal_users drop column first_name
(ps: I think the user table is named cal_users, but don't have access to my system right now so I can't check, so you might have to verify that for those queries)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-01-14
I am not having a problem adding users, although I am getting an error message saying "unable to complete the update". I've been looking at everything line by line and I'm going mad because I cant see anything wrong. Any ideas??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was getting a DB error message when I tried to create a user.
I then went to include/admin.php and added else return $cal_db->sql_error();
It now says Field 'first_name' doesn't have a default value. I only have boxes for username and password nothing for the first name. I tried the page in both IE and Firefox same issue.
When I add a event it says Unable to complete the update.
In my config I am using the root user and password for the mysql database for testing I have setup a DB called reece and all the tables are in the DB. Also mysql is version 5.0.45.
Config file information
// the sql server host - this is usually "localhost" if the database server is on the same machine
define("CAL_SQL_HOST","localhost");
// the sql database user that php will log in with
define("CAL_SQL_USER","root");
// the sql database user's password
define("CAL_SQL_PASSWD","rootpw");
// this defines the connection is to a mysql database. This is the only one supported at the moment.
define("CAL_SQL_TYPE","mysql");
// this is the name of the database the calendar tables are stored in.
define("CAL_SQL_DATABASE","reece");
// this is the prefix of the database tables. If you change the names of the tables, you need to change this.
define("CAL_SQL_PREFIX","cal_");
// this is the user password salt. do not change this unless you know what you are doing!
define("CAL_SQL_PASSWD_SALT", "!saltismyfriend!");
// the root username for the system
define("CAL_ROOT_USERNAME","root");
// the default root user password (overwritten later from options table)
define("CAL_ROOT_PASSWORD","abc123");
// This adds extra path info to where it looks for the css, javascript, and language files.
// normally this is blank, but if you are loading the calendar from a file in a
// different directory, you will probalby need to this for it to find the files it needs.
define("CAL_INCLUDE_PATH","");
// This defines if the calendar is stand alone, or integrated into a website
define("CAL_STAND_ALONE", TRUE); // true or false
// only used if CAL_STAND_ALONE is true. Sets the title tags in the html header to this.
define("CAL_STAND_ALONE_TITLE","Reece PHP Calendar");
// this defines if you want to use a query designed for MySQL 5.0.0 and above or a query deisgned for MySQL 4.1.1 and above.
define("CAL_SQL_MYSQL_5", True); // Change to false if you don't have MySQL 5 yet!
Any suggestions I’m at a loss Thanks
Eric
That is a database issue. Your version of MySQL is requiring a value for the first_name column since no default is specified in the database, and my script is not specifying the first_name (havn't put that functionality there yet).
You can either add the default with something like this:
ALTER TABLE cal_users CHANGE first_name first_name VARCHAR( 50 ) NOT NULL DEFAULT ''
OR you can just drop the column since it's not used right now:
alter table cal_users drop column first_name
(ps: I think the user table is named cal_users, but don't have access to my system right now so I can't check, so you might have to verify that for those queries)
I am not having a problem adding users, although I am getting an error message saying "unable to complete the update". I've been looking at everything line by line and I'm going mad because I cant see anything wrong. Any ideas??