”правление сайтом(CMS): mAdmin от www.Site.net.ua
TinySQL

The command ALTER TABLE ADD is to do add columns and descriptions of tables.

A simple solution

for small sites

  • 100% portability
  • Simple interface
  • The speed is limited only by the capacity your HDD
  • API for those who wish to spread the UI and ServerSide (in development)

ALTER TABLE ADD

The command ALTER TABLE ADD is to do add columns and descriptions of tables:

ALTER TABLE ADD col=name,name1,name2...

For example:

#!/usr/bin/perl -w

require "tinysql.pm";

%config=(
'base_root' =>'/home/localhost/public_html/basa/data'
);

$head=&tiny_sql(
 'command' =>"ALTER TABLE ADD col=name,name1",
'base_root' =>$config{'base_root'},
 'table_name' =>'index'
);

This command create columns name and name1 in to the table index.

Note: If you use command ALTER TABLE ADD for the table which already has records in all lines columns with appropriate names and with value 'null' will be created

In case of successful performance of a command - it is returned 1, otherwise - 0.

As a rule, command ALTER TABLE ADD is used right after table creation to receive the table ready to usage with the assigned columns. More in detail about application and syntax of a command it is possible to read on page of examples of usage ALTER TABLE ADD.


As advertising
Site developer - Site! ltd.