Overview of NULL, NOT NULL, and defaults

"Standard" SQL specifies the following rules:

  1. For each row in table, a column can contain a value or NULL which indicates "no value."
  2. If a column is declared NOT NULL, it must always contain a non-NULL value; NULL is not allowed.
  3. Columns can have a default value.

When inserting a row without providing an explicit value for a column, that column will get the default value if the column has one or NULL if the column is not specified as NOT NULL. Otherwise, an error is generated.

For example, consider the following table definition and matching CREATE TABLE statement:

$schema['T'] = array(
  'fields' => array(
    'i1' => array('type' => 'int'),
    'i2' => array('type' => 'int', 'not null' => TRUE),
    'i3' => array('type' => 'int', 'not null' => TRUE, 'default' => 17)
  ));

CREATE TABLE T(
  i1 integer,
  i2 integer NOT NULL,
  i3 integer NOT NULL DEFAULT 17
)

Column i1 can be an integer or NULL. Column i2 can only be integer, not NULL, and a value MUST be provided for every row. Column i3 can only be an integer, not NULL, but if a value is not provided for a row the value 17 is used instead.

This table definition controls what kind of INSERT statements are legal:


INSERT INTO T (i1, i2, i3) VALUES (0, 0, 0) -- okay
INSERT INTO T (i2, i3) VALUES (0, 0) -- okay; i1 is NULL

Several Unexpected Errors After Changing Webhosts – Advice?

Hello all,

Here's my situation:

I created a site with Drupal on my personal web hosting account because my professor (the guy I'm doing this for) didn't have access to his at the time I did it. He wants me to move it now (he gave me all the FTP and control panel info).

I didn't think moving would be an issue (do a mysql backup and restore), move all my drupal files, and edit settings.php. I'm getting a serious number of errors. Could someone possibly take a look and maybe give me some insight as to what I did wrong?

Thanks.

help: jquery, loop $.get() the same page

hi, I'm trying to achieve something like the batch function.

I would like to continuously loop a $.get() request of the same page. This is what I've got so far ...

Contributed Module Status - found on wiki pages at g.d.o for each major release

People often wonder what the status is of Drupal contributed modules, especially just before and after a new version of Drupal such as 5.x or 6.x is made available to the public. People wonder, "Will module xyz be updated soon?" or "Will module abc be integrated into core?" or "Will module 123 be discontinued?"

In an attempt to provide everyone an informal list and quick glance on the status of contributed modules, a group was created to address this need. For each major release, e.g. 5.x, 6.x, 7.x, etc., an informal list of plans for contributed modules being ported is made available via a wiki page on the Contributed Module Status Group. This group's benefit to the Drupal community is that ANYONE will be able to view the status of contributed modules that have been included AND make updates via wiki edits. The goal is to include ALL contributed modules.

A wiki page will be created for each Drupal release, and each wiki page will be an informal list of plans for contributed modules being ported to that release. The list of plans will consist of informal guesstimates and no one should expect exact delivery dates. However, if you are a module maintainer and/or have an idea of if and/or when a specific contributed module will be getting ported to a specific major release, your comments would be especially helpful. The hope is that this group and its wiki pages will become THE status resource for ALL contributed modules, THE place where everyone can go to see what will happen to this or that module before, during, and after a major release.

Lifeblog

Are there any plugins or solutions available to use the Lifebolg functionality in Nokia phones to post blog entries to Drupal?

TY!

/p

Who's who site (a variation of resumé, CV and Facebook)

I'm currently trying to create a site where I list politicians, their current elected positions and their history. This would on the surface seem to be something which fits existing modules, and it probably is. I've been trying to solve this in several different ways, but how I want it is hard to do it.

First I was thinking each person is a member of a group (a political party, a government etc), so organic groups might be what I need. No, b/c I need to create a user for each person I'm modelling, and they will never log in, and they all require e-mail addresses. Of course, coupled with Node Profile and CCK might be the way to go.

I'm fairly certain I need to use CCK. But I have two problems, one is with views, and one with CCK.

The CCK problem is the most pertinent. I'd like to add functionality which lets an administrator add a kind of resume. Ie. there will be a table/list of things happening in the life of the person:

June 5, 1995 -- CEO of ACME Inc.
April 6, 1995 - June4, 1995 CEO of ACME Inc. subsidiary ACME Paint.

etc.

The number of entries can be from 0 to unlimited. This is my first stumble block, what do I need for CCK to have a field which can expand like that?

The second stumble block is how can I make a field which requires both a date and a node and/or taxonomy reference.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x