slitz Posted February 8, 2007 Report Posted February 8, 2007 Es jau kā veselu stundu censos 'izprintēt' savu datubāzi, bet nekas nesanāk! Lūdzu palīdziet! Es izveidoju šādu tabulu, un pēctam saliku v;ertības. mysql_query("CREATE TABLE `kautkas` ( `id` int(11) NOT NULL auto_increment, `vards` varchar(200) NOT NULL default '', ) TYPE=MyISAM;") or die("Could not create table.".mysql_error()); Un mēģinu izvadīt, nekādi erori neparādās, vnk neko neizvada! $result = mysql_query("SELECT * FROM kautkas ORDER BY id"); while($row = mysql_fetch_array($result)) { echo $row['vards']; echo " " . $row['id']; echo "<br />"; } ?>
Val Posted February 8, 2007 Report Posted February 8, 2007 Ja tev kodā nav kļūdas, tad neko arī neredzēsi, jo izveidoji tukšu tabulu bez ierakstiem.
slitz Posted February 8, 2007 Author Report Posted February 8, 2007 (edited) Tādā gadījumā jautājums, vai šādi drīkst? mysql_query("INSERT INTO `kautkas` VALUES (1, 'eee'); INSERT INTO `kautkas` VALUES (2, 'hhh'); INSERT INTO `kautkas` VALUES (3, 'ggg'); INSERT INTO `kautkas` VALUES (4, 'fff'); INSERT INTO `kautkas` VALUES (5, 'ddd'); INSERT INTO `kautkas` VALUES (6, 'sss'); INSERT INTO `kautkas` VALUES (7, 'aaa');"); Edited February 8, 2007 by slitz
Grey_Wolf Posted February 8, 2007 Report Posted February 8, 2007 slitz--> labaak saadi INSERT INTO `a` ( `id` , `vards` ) VALUES ( '', 'kautkas') Vai shadi INSERT `a` SET vards='bala bla bla' aUTO INCRAMENT PATS PIELIKS id vertibu kas buus unikala dotajai tabulai....
andrisp Posted February 8, 2007 Report Posted February 8, 2007 Vienam mysql_query nevar padot vairākus kverijus.
Grey_Wolf Posted February 8, 2007 Report Posted February 8, 2007 andrisp --> mulkjiibas !!!! kautch 100... tik vinjus jadala ar ; jo principaa tas tiek pa taisno nosuutiits uz MySQl un tam var padot neierobezotu skaitu qverijus... Piedevam kaa peec tavaam domaam ir atrisinata problema ar Dampu ievadiishanu caur PhpMyAdmin?? vai domaa ka vinsh visu sadala pa kverijiem??? slitz --> ta kaa tavs risinaajums bija pilniigi pareizs, iznjemot to ka pats kverijs/iji nebija pareizi... + beigaas Nevajag ;, kautgan tas lielu lomu nespeelee
andrisp Posted February 8, 2007 Report Posted February 8, 2007 Pareizi. Es nepareizi sapratu manuāli.
Recommended Posts