[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

mysql:4132

From: "tamuzin2" <"tamuzin2" <tamuzin@xxxxxxxxxx>>
Date: Fri, 3 Aug 2001 16:26:25 +0900
Subject: [mysql 04132] MySQL INSERT ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤Ç¤­¤Ê¤¤

ÅÄÃæ¤Ç¤¹¡£

²¼µ­¤Î¤è¤¦¤Ê£Ð£å£ò£ì¤Ç¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÁàºî¤¹¤ë¥×¥í¥°¥é¥à¤òºîÀ®¤·¤¿¤Î¤Ç¤¹¤¬¡¢
¥Õ¥©¡¼¥à¤«¤éÁ÷¿®¤·¤¿¥Ç¡¼¥¿¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÁÞÆþ¤µ¤ì¤Ê¤¯¤Æº¤¤Ã¤Æ¤¤¤Þ¤¹¡£
¤É¤Ê¤¿¤«²¼µ­¤Î¥×¥í¥°¥é¥à¤Î¤É¤³¤¬°­¤¯¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÁÞÆþ¤µ¤ì¤Ê¤¤¤Î¤«¤ª¶µ¤¨¤¯
¤À¤µ¤¤µ¹¤·¤¯¤ª´ê¤¤Ãפ·¤Þ¤¹¡£

#!perl

require"jcode.pl";

use DBI;
use CGI_Lite;

my($dns) = "DBI:mysql:shopping:localhost";
my($username) = "root";
my($password) = "aaaa";
my($dbh,$sth);
my(@ary);

$RemoteUser=$ENV{'REMOTE_USER'};

$cgi=new CGI_Lite();
%in=$cgi->parse_form_data();
print"Content-type: text/plain\n\n";

#¿·µ¬ÅÐÏ¿½èÍý
if($in{'mode'} eq 'new'){
 &Error("µ­Æþϳ¤ì¤¬¤¢¤ê¤Þ¤¹¡£") unless $in{'kategorii'};

 #¤³¤³¤Ç¤ÏEUC¥³¡¼¥É¤Ç¥Ç¡¼¥¿¤òÁÞÆþ¤·¤Æ¤ß¤ë»ö¤Ë¤¹¤ë¡£É½¼¨¤ÏSJIS¤òÍøÍÑ
 $kategorii=$in{'kategorii'};
 &jcode'convert(*kategorii,"euc");

 $dbh = DBI -> connect ($dns,$username,$password) or &Error("¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø
¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¡£");

 $sth = $dbh->prepare(qq{insert into kaimono (kategorii)
values("kategorii")});

 $sth -> execute() or &Error("MySQL INSERT ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡£");

 $sth -> finish();
 $dbh -> disconnect();
}#¿·µ¬ÅÐÏ¿½èÍý¤Ï¤³¤³¤Þ¤Ç

  $dbh = DBI -> connect ($dns,$username,$password) or &Error("¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø
¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¡£");

  $sth = $dbh->prepare(qq{select * from kaimono});

  $sth -> execute() or &Error("select * from kaimono¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡£");

  $sth -> finish();
  $dbh -> disconnect();


print "content-type: text/html\n\n";
print<<"__HTML__";
<html><head><title>¥·¥ç¥Ã¥Ô¥ó¥°´ÉÍý¥Ú¡¼¥¸</title></head>
<body text="#44444" bgcolor="#ffffff">
<table width="32%" border="0" cellspacing="1" cellpadding="1"
align="center">
  <tr>
    <td>
      <h2 align="center">¢¡¥·¥ç¥Ã¥Ô¥ó¥°´ÉÍý¥Ú¡¼¥¸¢¡</h2>
    </td>
  </tr>
</table>
<br>
<br>
<form method="post" action="kaimono.cgi">
  <table width="70%" border="3" cellspacing="4" cellpadding="5"
align="center">
    <tr>
      <td width="21%" bgcolor="#99CCFF">
        <div align="center"><font size="3"><b>¥«¥Æ¥´¥ê¡¼</b></font></div>
      </td>
      <td width="79%" bgcolor="#FDF9C1">
        <select name="kategorii">
          <option>±ÇÁüµ¡´ï</option>
          <option>µ­²±ÁõÃÖ</option>
          <option>¥Ç¥£¥¹¥×¥ì¥¤</option>
          <option>¥Í¥Ã¥È¥ï¡¼¥¯µ¡´ï</option>
          <option>ÆþÎÏÁõÃÖ</option>
          <option>£Ð£ÃËÜÂÎ</option>
          <option>¥×¥ê¥ó¥¿¡¼</option>
          <option>²»À¼µ¡´ï</option>
          <option>¥½¥Õ¥È</option>
          <option>¥¹¥­¥ã¥Ê¡¼</option>
        </select>
      </td>
    </tr>
  <input type="hidden" name="mode" value="new">
    <tr>
      <td colspan="2">
        <div align="center">
          <input type="submit" name="Submit" value="¾¦ÉÊÅÐÏ¿">
        </div>
      </td>
    </tr>
  </table>
</form>
__HTML__

sub Error{
#print "content-type: text/html\n\n";
print $_[0];
print qq(<br><a href="javascript:history.back(1)">Ìá¤ë</a>);
exit;
}

²ò¤ê¤Ë¤¯¤¤¥×¥í¥°¥é¥à¤Ç¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤¬µ¹¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£


[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

      4109 2001-08-01 10:55 ["tamuzin2" <tamuzin@] ¥Ð¥¤¥Ê¥ê¡¼¥Ç¡¼¥¿¤ò°·¤¦ÊýË¡¤Ï¡©          
      4121 2001-08-03 00:17 ¨±[Tatsuhiko Miyagawa <]                                       
      4122 2001-08-03 01:04 ¡¡¨²["tamuzin2" <tamuzin@]                                     
      4124 2001-08-03 06:08 ¡¡¨­¨±[Tatsuhiko Miyagawa <]                                   
      4131 2001-08-03 16:26 ¡¡¨­¡¡¨±["tamuzin2" <tamuzin@]                                 
->    4132 2001-08-03 16:26 ¡¡¨±["tamuzin2" <tamuzin@] MySQL INSERT ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤Ç¤­¤Ê¤¤ 
      4133 2001-08-03 16:55 ¡¡¡¡¨±[A Tsukui <milano@xxx]                                   
      4134 2001-08-03 17:31 ¡¡¡¡¡¡¨±["tamuzin2" <tamuzin@] Re: MySQL INSERT ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤Ç¤­¤Ê¤¤¡Ú²ò·è¡Û
      4135 2001-08-03 17:52 ¡¡¡¡¡¡¡¡¨²["Kawai,Takanori" <GC]                               
      4136 2001-08-03 18:07 ¡¡¡¡¡¡¡¡¨±[Yasuhide OMORI / Âç¿] placeholder (Re: MySQL INSERT ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤Ç¤­¤Ê¤¤¡Ú²ò·è¡Û)
      4137 2001-08-03 18:58 ¡¡¡¡¡¡¡¡¡¡¨±["tamuzin2" <tamuzin@]