Error Msg When adding to dataBase

J

Jeff Messick

Guest
Hello Just wanted to say this is an awsome script, great job with it.

Im trying to insert data useing the form.php?form_type=insert&table_name=events when i hit insert i get an error that states Error during query execution.
Ive checked the tables and even reloaded the script many times any ideas on this?? thanks in advance
 
S

Stan

Guest
When I had this error I discovered that I had MySQL configured to reject duplicate entries on a couple of fields, in my case first_name, last_name. You don't have this problem do you? Turn debugging on in PHP to see the error details printed to the screen when you execute.
 
J

Jeff Messick

Guest
Sorry im kinda new at this php sql thing learning as i go, i check to see if i had duplicate entries to reject selected its not enabled.

i have 3 tables in mysql
2 were produced from the script and one is events which i created. What do the "functions" need to be in the events table. or does that matter?

agian I am sorry for my lack of knowledge on this
 
E

Eugenio

Guest
Jeff Messick wrote:
>
> Hello Just wanted to say this is an awsome script, great job
> with it.
>
> Im trying to insert data useing the
> form.php?form_type=insert&table_name=events when i hit insert
> i get an error that states Error during query execution.
> Ive checked the tables and even reloaded the script many
> times any ideas on this?? thanks in advance

Do you still have the problem?

Eugenio.
 
J

Jeff

Guest
Yes was my mess-up. Can't remember what I did. but it worked!
 
J

Jeff

Guest
This is a common problem if you don't have your Primary key set to an auto incrementing field. Here's an example:

Your primary key is set to the field "city". You first record has the city value of Denver, and everything works fine. You insert several more records and then try to insert one with the city field of Denver again. The primary key has to be unique, so you get an error because the value "Denver" was used twice.

Check your primary key and make sure you have it set to an auto incrementing field. You may have to make another field, call it something like "ID", and make it the Primary Key. It is only used to index records and doesn't require any data input on a record insert.

Hope that helps...

Jeff
 
A

André

Guest
Hello,

here is my problem:

1. When inserting a new record into the table, the record will be added but
all the values are empty.
Here the SQL Command created by dadabik:
insert into `test` (`test_one`, `test_two`, `test_three`) values ('', '', '')

2. When updating a record i get an error like this:
Error during query execution.
update `test` set `test_one` = '', `test_two` = '', `test_three` = '' where `` = ''
MySQL server said: Unknown column '' in 'where clause'

My table: (for testing purpose)

field 1: id · int(33) · auto increment (not displayed in the insert form)
field 2: test_one · varchar(25)
field 3: test_two · varchar(25)
field 4: test_three · varchar(25)

Links:
http://www.agmd.de/dbtest/install.php
http://www.agmd.de/dbtest/admin.php

I tried everything but i got no solution. Would be nice if somebody could help me. Regards, André
 
A

André

Guest
Hello, yes it is. I think all the mySQL seetings are ok but i can send u the phpMA Link per mail to check the settings?

 
J

Jeff

Guest
It may help you to refer to another post of mine on seting up database tables. http://www.dadabik.org/forum/read.php?f=1&i=1235&t=351#reply_1235

Also, if you can do an sql dump of your database from phpmyadmin and post it here it would likey show where your problem is.
 
A

André

Guest
Hi Jeff,

thanks for your effort. I tried your sample table 'memberlist' but the same problem. Here is the dump of my table. Its very simple - but i have really no idea about the reason for these errors. May be its the database itself?

Links:
http://www.agmd.de/dbtest/install.php
http://www.agmd.de/dbtest/admin.php
http://www.agmd.de/dbtest/index.php

Dump:
Database test - table test running on localhost
# phpMyAdmin MySQL-Dump
# version 2.3.2
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Apr 24, 2003 at 12:22 AM
# Server version: 3.23.49
# PHP Version: 4.1.2
# Database : `test`
# --------------------------------------------------------

#
# Table structure for table `test`
#

CREATE TABLE test (
id int(33) NOT NULL auto_increment,
test_one varchar(25) NOT NULL default '',
test_two varchar(25) NOT NULL default '',
test_three varchar(25) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;

Kind regards,
André

 
A

André

Guest
Ok, i think it is definitive a problem of my database server. I generated the same table on another provider/database and there it works fine. What tf can it be?

 
J

Jeff

Guest
Andre,

Your table above looks fine to me. I tried adding it to my database just in case there was something I hadn't noticed, and it updated properly.

I just looked at your installation again and tried to add a record with the following results:

insert into `memberlist` (`id`, `last_name`, `first_name`, `address`, `city`, `state`, `zip`, `home_phone`, `work_phone`, `fax`, `email`, `customer_id`) values ('', '', '', '', '', '', '', '', '', '', '', '')

You will notice all the value fields are blank. I don't think this is a database problem as the record gets inserted and the id field updates, but all the value fields are sent to the query with no information. It's like the form for inserting a record is sending blank values when submitted.

I have no idea why the variables are not being set, but it's a little closer to the root of the problem.

Jeff

 
J

Jeff

Guest
Andre,

Your table above looks fine to me. I tried adding it to my database just in case there was something I hadn't noticed, and it updated properly.

I just looked at your installation again and tried to add a record with the following results:

insert into `memberlist` (`id`, `last_name`, `first_name`, `address`, `city`, `state`, `zip`, `home_phone`, `work_phone`, `fax`, `email`, `customer_id`) values ('', '', '', '', '', '', '', '', '', '', '', '')

You will notice all the value fields are blank. I don't think this is a database problem as the record gets inserted and the id field updates, but all the value fields are sent to the query with no information. It's like the form for inserting a record is sending blank values when submitted.

I have no idea why the variables are not being set, but it's a little closer to the root of the problem.

Jeff
 
A

André

Guest
OK, i will find a solution an post it here. Thanks for your time. André
 
M

Mathieu

Guest
I have the same problem. Did someone find the answer to it?
 
M

Mathieu

Guest
The form seems to not send any data to the update string... I have set debug mode to ON to see the SQL query and it seems to receive no arg. from the form. Does somebody know if there's a special setting to set in apache to make dadadik work?
 
E

Eugenio

Guest
Mathieu wrote:

> The form seems to not send any data to the update string... I
> have set debug mode to ON to see the SQL query and it seems to
> receive no arg. from the form. Does somebody know if there's a
> special setting to set in apache to make dadadik work?

For all people having problems with insert/update, could you please post here the dumps of your db (including dadabik tables)?



(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
Top