Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Złe zapytanie do bazy lub typ pola
vegeta
post
Post #1





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 9.11.2008

Ostrzeżenie: (10%)
X----


Witam.

Mam zapytanie update do bazy:
  1. (...)`gg` = '.$_POST['gg'].', `omnie` = '.$_POST['omnie'].',(...)

Problem pojawia się przy omnie. Pole omnie w MySQL to text. Varchar i Tinytext też nie działa.
Kod
SQLSTATE[42S22]: Column not found: 1054 Nieznana kolumna 'Text' w field list
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
vegeta
post
Post #2





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 9.11.2008

Ostrzeżenie: (10%)
X----


Kod
CREATE TABLE `user` (
  `id` int(11) NOT NULL auto_increment,
  `login` varchar(30) NOT NULL default '',
  `haslo` varchar(35) NOT NULL default '',
  `rej` datetime NOT NULL default '0000-00-00 00:00:00',
  `mail` varchar(35) NOT NULL default '',
  `gg` int(8) default NULL,
  `wiek` int(2) default NULL,
  `imie` varchar(15) default NULL,
  `nazwisko` varchar(30) default NULL,
  `miasto` varchar(20) default NULL,
  `plec` char(1) default NULL,
  `omnie` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `login` (`login`),
  UNIQUE KEY `mail` (`mail`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin2 AUTO_INCREMENT=4;


  1. $stmt = $pdo -> prepare('UPDATE `user` SET `wiek` = '.$_POST['wiek'].', `gg` = '.$_POST['gg'].', `omnie` = '.$_POST['omnie'].', `plec` = '.$_POST['gg'].', `imie` = '.$_POST['imie'].', `nazwisko` = '.$_POST['nazwisko'].', `miasto` = '.$_POST['miasto'].' WHERE `id`='.$_SESSION['user_id'].'');
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 10.10.2025 - 19:14