Jump to content
php.lv forumi

ievietot datubāzē


Puika1

Recommended Posts

kautkāda kļūda

ALTER TABLE `cup` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT

MySQL said: Documentation

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

 

CREATE TABLE `cup` (

`id` int(11) NOT NULL,

`name` text NOT NULL,

`link` text NOT NULL,

`info` text NOT NULL,

`cena` text NOT NULL,

`bilde` text NOT NULL,

`game` text character set utf8 collate utf8_latvian_ci NOT NULL,

`veids` text character set utf8 collate utf8_latvian_ci NOT NULL,

`admin` text character set utf8 collate utf8_latvian_ci NOT NULL,

`start` text character set utf8 collate utf8_latvian_ci NOT NULL,

`status` text character set utf8 collate utf8_latvian_ci NOT NULL,

`prize` text character set utf8 collate utf8_latvian_ci NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Edited by Puika1
Link to comment
Share on other sites

Piemēram ar php labot tabulu!

piem. tabulas id 1 un lauki name info utt (velme ir labot tos name info utt) nejau visiem irerakstiem,bet pec konkreta id

$q=sprintf("UPDATE tabula SET lauks1=%s,lauks2=%s,laiks3=%s WHERE id=%d",$string1,$string2,$string3,$id);

mysql_query($q);

 

Vai, ja nepatīk sprintf (un datu tipu pārbaude) tad:

$q=mysql_query"UPDATE tabula SET lauks1=$string1 WHERE id=$id";

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...