[PHP-users 15173]htmlフォームからphpでdbを操作できないのは?
アキヨシ
akiyoshi-w @ wa.jsystem.co.jp
2003年 5月 12日 (月) 08:44:36 JST
$B$3$s$K$A$O!#%"%-%h%7$H$$$$$^$9!#(B
$B0JA0!"(Bwindows98SE$B$G(Bphp$B$,5/F0$7$J$$$N$O!)!!$H<ALd$r4s$;$?<T$G$9!#(B
$B:#$O!"(Bhtml$B%U%)!<%`$+$i(Bdb$B$rA`:n$9$k!A(Bphp$BJT!A$^$G?J$s$@$N$G$9$,(B
$B<ALd-!(B
localhost(windows98se)$B$G!"(Bmysql$B$+$i%G!<%?$r<h$j=P$9(Bphp$B%9%/%j%W%H$,5!G=$7$J$$(B
$B$N$O!)(B
winmysqladmin$B!!5Z$S!!(BStart Apache in Console$B$b5/F0Cf$N4D6-$G(B
http://localhost/php/test_my_php.php$B!!!!%F%9%H%Z!<%8$^$G$OI=<($G$-$^$7$?!#(B
$BA0Ds$H$7$F(B
$B%F!<%V%kI=<($N!Z(B table.html $B![$H!"%G!<%?A47oI=<($N!Z(B select.php $B![$r:n @ .$7$F(B
C:\Apache\htdocs\php$BG[2<$K(B(table.html$B$H(Bselect.php$B$O(B)$BCV$-$^$7$?!#(B
http://localhost/php/table.html $B#o#k!!%F!<%V%k$NI=<($O$G$-$^$7$?$,!#(B
http://localhost/php/select.php$B!!!_!!!!%G!<%?(B($BA47oI=<((B)$B$,$G$-$^$;$s$G$7$?!#(B
$B2?8N!*(B
$B2<5-$,$=$N$H$-$N%(%i!<%a%C%;!<%8$G$9!#(B
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in c:\apache\htdocs\php\select.php on line 21
$B3:Ev$9$k%G!<%?$,8+$D$+$j$^$;$s$G$7$?!#(B
line 21$B$H$O!"(B$result = mysql_query($query);$B$N;v$G$9$,!"6qBNE*$K(B
$B$I$&$$$&$3$H$G$7$g$&$+!)(B
$B<ALd-"(B
$BA0=hM}$H$7$F(B
resutaurant_db$B$KBP$7$F!"A48"8B$rM?$($k$?$a2<5-$rF~NO$7$^$7$?!##O#K$G$7$?!#(B
use mysql
insert into user set user = "chef" , password = password("secret"), host =
"localhost";
flush privileges;
grant all on resutaurant_db.* to chef @ localhost identified by "secret";
flush privileges;
$B>e5-$N!"(Binsert into user$B$r:F$S(B(2$B2sL\$r(B)$BN.$7$?;~$K$O2<5-$N%(%i!<$H$J$C$?$N$O(B
$B!)(B
error 1062: duplicate entry 'localhost-chef' for key 1$B!!(B
$B4{$K%f!<%6$O!"(Bmysql$B%G!<%?%Y!<%9Fb$N(Buser$B%F!<%V%k$KDI2C$G$-$F$$$k$+$i(B
$B$b$&I,MW$N$J$$=hCV$G$"$k!#$HM}2r$7$F$$$$$N$G$7$g$&$+!)(B
PHP-users メーリングリストの案内