473,408 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

"Column 'Name' cannot be null"

Hi All, I create a form for the user to enter the information, the
form contains two table, table A and table B. I wrote a script to
prompt the user to fill all the necessary data if they miss to fill in
one column. The problem I met now is once I fill the data of first
table and leave the second data blank, an error occured to prompt the
user to fill the second table and return to main page again, after I
clicked ok and error message displayed "Column 'Name' cannot be null"
and the information I entered previously was stored into the database.
If I key in the information again, the data is duplicate in the
database. How to avoid that? Thanks
Best Regards,
Hau Jyn
Jul 17 '05 #1
1 6548
Here's a hint: don't ever add data to a data-base, when its not absolutly
correct/complete, because there's no ensurence, that the user will add the
missing data.

if( **ALL DATA INPUT CORRECT (nothing is blank)** ){
**ADD DATA TO DATABASE**
}else{
**PROMT USER TO ENTER DATA CORRECTLY**
**RE-ECHO THE FORM WITH PRE-ENTERED DATA**
}

This should work correctly, without doublicated data.

To avoid that the user has to re-enter data, that has already been entered
once, you could use the $_REQUEST variables and the VALUE properties of
<input ...> and <textarea>...</textarea> (whatever).

It's been used like this:

echo '<input type="text" name="D_NAME" value="'.$_REQUEST["D_NAME"].'">';
echo '<textarea name="D_TEXT">'.$_REQUEST["D_TEXT"].'</textarea>';
// D_NAME and D_TEXT could be anything (must be a valid name).
So, when the user forgets to enter some data, he will be asked to fill out
the form again, BUT the data he/she previously entered will be in the form,
already, so he/she only has to add the data he/she forgot.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Prince Kumar | last post by:
Is there any way I can define an Unique constraint or unique index which allows more than one null values for the same column combination in DB2? ie, If my index is defined on (col3, col4) where...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
1
by: Andy L | last post by:
I have two identical databases running on two separate servers. I want to add a column to the following table: classified_cats { acid , name , parent } Running ALTER TABLE `classified_cats`...
17
by: Darek | last post by:
Hi, I have a table, something similar to: create table my_table ( id char(32) not null primary key, num integer not null, code varchar(2) not null, name varchar(60) not null,
1
by: alain MONTMORY | last post by:
Hello everybody, I am a newbie to python so I hope I am at the right place to expose my problem..... :-http://www.python.org/doc/2.4.2/ext/pure-embedding.html 5.3 Pure Embedding I download the...
0
by: lgalumbres | last post by:
Hello, I have a DataGridView control with a DataGridViewComboBoxColumn that allows users to choose selections from a list. The DataGridView is bound to a DataTable object and the...
2
by: oopaevah | last post by:
I am using the Microsoft.XMLHTTP object to make server requests ie; ajax. This is working 99% of the time but occasionally it will freeze at the server for 5 minutes and then raise a javascript...
1
by: Ducknut | last post by:
Not so much a problem as a discussion. I am currently in the early stages of designing a database to hold a bunch of water quality data (e.g., concentrations of heavy metals in drinking water). Water...
5
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.