Jump to content
php.lv forumi

Recommended Posts

Posted (edited)

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
Posted

Man nez kāpēc aizdomas, ka tas dēļ primary key. Apskaties vai kādam citam laukam nav primary key uzlikts. Ja slinkums čakarēties un tabulā nav nekādu dižo datu, tad nodropo un uztaisi pareizi jaunu tabulu.

Posted

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";

Posted

čota nesapratu,bet uzgooglēju atradu dažus variantus,bet man neīpaši pie sirds,ka tas sastāv no 4 php failiem Kāds zin kādus scriptus google,kas sastāv no 1 vai 2 php failiem?

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...