Apache$B$H(JM$B#y(JSQL$B$H(JPHP$B$NAH$_9g$o$;$G8!:w%U%)!<%`$r:n$C$F$_$h$&(J
 
All About Japan $B$N(J
 
WEB+DB$B%W%m%0%i%_%s%0$N4pAC(J
Apache + PHP + MySQL$BJT(J
$B$N5-;v$r;29M$K!J$C$F$[$H$s$I$=$N$^$^!&!&!&!K(J
$B%-!<%o!<%I$r4^$`5-;v$rC5$7=P$7$F0lMwI=$K$9$k%W%m%0%i%`$r=q$-$^$7$?!#(J
$B0l%Z!<%8$K(J10$B9`L\%Z!<%8Aw$j$D$-$G$9!#(J
 
$B<+J,$,9)IW$7$?$N$O%G!<%?$N
$B$A$g$C$H8+1I$($,0-$$$G$9$,!"(JURL$BMs$K%/%(%j!<$NCf?H$,=P$F$-$^$;$s!#(J
$B$^$"%9%?%$%k%7!<%H$G$J$s$H$+8e$+$i$4$^$+$7$F$/$@$5$$!J4@!K(J
 
 
$B$^$::G=i$K(JM$B#y(JSQL$B$K%G!<%?%Y!<%9(Jtest$B$r:n$j$^$9!#(J
$BIaDL$O(JMySQL$B$r%$%s%9%H!<%k$9$k$H<+F0$G$G$-$F$k(JDB$B$G$9$M!#(J
$B$3$l$O$4<+J,$N9%$-$J(JDB$B$r:n$C$F$b$+$^$$$^$;$s$,$=$N>l9g$O2<$N%W%m%0%i%`$N(JDB$B!!(Jtest$B!!$r(J
$B=q$-D>$7$F$/$@$5$$$M!#(J
 
$B
$B$=$7$F(J
 
create table tab1(id int not null auto_increment primary key, field1 varchar(100) not null, field2 text, field3 text, field4 text);
 
 
----------------------------------------
        
 id   |    field1   |     field2  |   field3 |    field4
 
-----------------------------------------
 
$B$H9`L\$r:n$j$^$9!#(J
$B$=$7$F$3$3$K<+J,$N8!:w$7$?$$%G!<%?$r$^$:FM$C9~$s$G$$$-$^$9!#(J
 
MySQL$B$X$N%G!<%?$NF~$lJ}$O(JAll About Japan$B!!$N5-;v$rFI$s$G$/$@$5$$!#(J
 
$B$=$7$F!"(JApache$B$G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IV=\"Content-Type\" CONTENT=\"text/html; charset=\"Shift_JIS\">\n");
 
//HTML$BJ8$r=PNO!!(JTITLE$B$N;XDj(J
print("<TITLE>$B8!:w%U%)!<%`(J PHP$BHG(J</TITLE>\n");
 
//HTML$BJ8$r=PNO!!(JHEAD$B$N=*N;(J
print("</HEAD>\n");
 
//HTML$BJ8$r=PNO!!(JBODY$B$N3+;O(J
print("<BODY bgcolor=#33ffff text=#0000ff>\n");
 
//HTML$BJ8$r=PNO!!EPO?3NG'(J
print("<b>$B%-!<%o!<%I8!:w(J</b><br><br>");
 
//HTML$BJ8$r=PNO!!(JFORM$B$N3+;O(J
print("<FORM action=kennsakup.php method=post>");
 
//HTML$BJ8$r=PNO!!F~NO%U%#!<%k%I$N@bL@(J
print("$B2?$r$7$i$Y$^$9$+!)(J<br><br>");
 
//HTML$BJ8$r=PNO!!F~NO%U%#!<%k%I$N;XDj(J
print("<INPUT type=text name=inpnum size=8 maxlengh=8><br><br>");
 
//HTML$BJ8$r=PNO!!3NG'%\%?%s(J
print("<INPUT type=submit value=$B3NG'(J>");
 
//HTML$BJ8$r=PNO!!C%\%?%s(J
print("<INPUT type=reset value=$BC(J><br>");
 
//HTML$BJ8$r=PNO!!(JFORM$B$N=*N;(J
print("</FORM>");
 
 
 
//HTML$BJ8$r=PNO!!(JBODY$B$N=*N;(J
print("</BODY>\n");
 
//HTML$BJ8$r=PNO!!(JHTML$B$N=*N;(J
print("</HTML>\n");
?>
$B!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v(J
 
 
kennsakup.php $B$NFbMF(J
 
$B!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v(J
 
<?
 
//$BJGFb$KI=<($9$k9T?t(J
$maxline = 10;
 

print("<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=\"Shift_JIS\"><TITLE>$B8!:w7k2L(J</TITLE></HEAD>\n");
 
print("<BODY bgcolor=#33ffff text=0000ff>\n");
 
//kennsaku.php$B$+$iF~NO%U%)!<%^%C%H$KF~NO$5$l$?%G!<%?$r(Jpost$B$GEO$5$l$k$N$G(J
//$HTTP_POST_VARS$B$K$h$j%U%#!<%k%I(J inpnum$B!!$NFbMF$r//$HTTP_POST_VARS$B$K$h$j%U%#!<%k%I(J page$B!!$NFbMF$r
 

$key = $HTTP_POST_VARS["inpnum"];
$page= $HTTP_POST_VARS["page"];
 
 
 
//DB$B$X@\B33+;O(J $B%5!<%P!(J--localhost($B$^$?$O(JIP$B%"%I%l%9!K(J $B%f!<%6!(J--root $B%Q%9%o!<%I(J--root
$dbHandle = mysql_connect("localhost","user","password");
 
//DB$B$N@\B3$K<:GT$7$?>l9g$O%(%i!if ($dbHandle == False) {
 print ("can not connect db\n"); 
 exit;
}
 
 
 
/$BJG?t$,%;%C%H$5$l$F$$$J$$>l9g$OJG?t$K(J1$B$r%;%C%H(J
if ($page < 1) {
 $page = 1;
}
//$B3+;O9T$r;;=P(J
$startline =  ($page - 1) * $maxline;
 
//$B=*N;9T$r;;=P(J
$endline   =  $page * $maxline -1;
 
 
 

//db$BL>(J  test
$db = "test";
 

//SQL$BJ8(J tab1$BI=$+$i(Jfield1$B$+$i(Jfield3$BNs$NCf$K(J$key$B$r4^$`8l6g$,$"$l$P>:=g(J(order by )$B$GH4$-=P$9(J
$sql = "select * from tab1 where (field1 like '%$key%' or field2 like '%$key%' or field3 like '%$key%') order by id";
 
//SQL$BJ8$r $rs= mysql_db_query($db,$sql);
 
//$BNs?t$r$num = mysql_num_fields($rs);
 
//$B//ceil($B?tCM(J)$B$O>.?tE@0J2<$r@Z$j>e$2$k4X?t(J
$maxpage = ceil(mysql_num_rows($rs) / $maxline);
 
//HTML$BJ8$r=PNO!!%F!<%V%k$N3+;O$r;XDj(J
print("<table border=1>");
 
//$B8=:_$NJG(J/$B:G=*JG$rI=<((J
print("<caption valign='top' align='right'>Page ".$page."/".$maxpage."</caption>");
 
//mysql_num_fields$B!!4X?t$r;HMQ$7Ns?t$r$fields = mysql_num_fields($rs);
 

//mysql_num_rows$B!!4X?t$r;HMQ$79T?t$r$rows = mysql_num_rows($rs);
 

//$BF~NO$5$l$?(Jnumber$B$N9T$,$"$C$?>l9g$O%G!<%?$r=PNO$9$k(J
if ($rows > 0) {
 
//HTML$BJ8$r=PNO!!%F!<%V%k$N3+;O$r;XDj(J
 print("<TABLE border=1>");
 
//test$BI=$NNs?t$HF1$82s?t$r7+$jJV$9(J
 for ($i=0;$i<$fields;$i++){
 
//HTML$BJ8$r=PNO!!NsL>$r(J <td>$B$G0O$s$GB@;z$G=PNO(J
  print("<td><b>".mysql_field_name($rs,$i)."</b></td>");
 }
 

//mysql_data_seek$B$K$h$j(Jtest$BI=Fb$N;XDj$7$?9T$K0\F0$9$k(J
mysql_data_seek($rs,$startline);
 
//$i$B$K(J$startline$B$rBeF~(J
$i=$startline;
 
//$B:G=*9T$G$J$/!!$+$D!!(J$i<=$endline$B$N>r7o$N4V(J
//test$BI=$+$i9T$rwhile($row=mysql_fetch_array($rs) and $i<=$endline){
 
//HTML$BJ8$r=PNO!!I=$N9T$N3+;O(J<tr> $B$r=PNO(J
 print("<tr>");
 
//test$BI=$NNs?t$HF1$82s?t$r7+$jJV$9(J
 for($j=0;$j<$fields;$j++){
 
//HTML$BJ8$r=PNO!!Ns$NFbMF$r(J <td>$B$G0O$s$G=PNO(J
  print("<td>".$row[$j]."</td>");
 }
//HTML$BJ8$r=PNO!!I=$N2~9T(J</tr> $B$r=PNO(J
 print("</tr>");
 
//$i$B$K(J1$B$r2C;;(J
 $i = $i + 1;
}
 
}
//$BF~NO$5$l$?(Jnumber$B$N9T$,B8:_$7$J$+$C$?>l9g$O%(%i!<%a%C%;!<%8$r=PNO$9$k(J
else {
 print("  [" .$key . "]  $B$N%G!<%?$OEPO?$5$l$F$$$^$;$s(J<br>");
 

//HTML$BJ8$r=PNO!!%F!<%V%k$N=*N;$r;XDj(J
print("</TABLE>");
//HTML$BJ8$r=PNO!!%F!<%V%k$N3+;O$r;XDj(J
print("<table><tr>");
//HTML$BJ8$r=PNO!!(Jcaption $B$r=PNO(J
print("<caption align='bottom'>");
 
//$B8=:_I=<($7$F$$$kJG$,#1%Z!<%8$h$j8e$NJG$N>l9g$OA0$NJG$N%j%s%/$r:n@.(J
if ($page > 1) {
  $i = $page - 1;
//HTML$BJ8$r=PNO!!(J.$page$B$K;XDj$5$l$?JG?t$r%;%C%H$7$F(JGET$B$GEO$9%j%s%/$r:n@.(J
                        print("<td>");
   print("<FORM action='$PHP_SELF' method=post>");
                        print("<INPUT type=hidden name=inpnum value= ".$key.">");
                        print("<INPUT type=hidden name=page value= ".$i.">");
                        print("<INPUT type=submit value=$BA09`(J>");
                        print("</FORM>");
                        print("</td>");
}
 
//$B8=:_I=<($7$F$$$kJG$,#1%Z!<%8$G$O$J$/:G=*JG$G$O$J$$>l9g$OA0JG$H//$B6h@Z$k!V!&!W$r=PNO(J
if ($page <> 1 and $page <> $maxpage) {
                        print("<td>");
 print("$B!&(J");
                        print("</td>");
}
 
//$B8=:_I=<($7$F$$$kJG$,:G=*JG$h$jA0$NJG$N>l9g$OA0$NJG$N%j%s%/$r:n@.(J
if ($page < $maxpage) {
   $i = $page + 1;
//HTML$BJ8$r=PNO!!(J.$page$B$K;XDj$5$l$?JG?t$r%;%C%H$7$F(JGET$B$GEO$9%j%s%/$r:n@.(J
                        print("<td>");
   print("<FORM action='$PHP_SELF' method=post>");
                        print("<INPUT type=hidden name=inpnum value= ".$key.">");
                        print("<INPUT type=hidden name=page value= ".$i.">");
                        print("<INPUT type=submit value=$B                        print("</FORM>");
                        print("</td>");
}
//HTML$BJ8$r=PNO!!%F!<%V%k$N=*N;$r;XDj(J
print("</tr></TABLE>");
///HTML$BJ8$r=PNO!!2~9T(J
print("<br>");
                        print("<table><tr>");
//$B=PNO2DG=$JJG?t?tJ,7+$jJV$9(J
for ($i=1;$i<=$maxpage;$i++) {
 
 
 

//$B8=:_$NJG$N;~$O(J [ ]$B$G0O$`(J
 if ($i==$page){
                        print("<td>");
  print("[".$i."]");
                        print("</td>");
 } else {
//HTML$BJ8$r=PNO!!(J.$page$B$K;XDj$5$l$?JG?t$r(JGET$B$GEO$9%j%s%/$r:n@.(J
                        print("<td>");
   print("<FORM action='$PHP_SELF' method=post>");
                        print("<INPUT type=hidden name=inpnum value= ".$key.">");
                        print("<INPUT type=hidden name=page value= ".$i.">");
                        print("<INPUT type=submit value=".$i.">");
                        print("</FORM>");
                        print("</td>");
}
//$B:G=*JG0J30$G$OJG4V$r6h@Z$k!V!&!W$r=PNO(J
 if ($i <> $maxpage) {
                        print("<td>");
  print("$B!&(J");
                        print("</td>");
 }
 

      if($i%10==0){
                        print("</tr><tr>");
 
}
    
 

}
 
                        print("</tr></table>");
 
//HTML$BJ8$r=PNO!!(J/caption $B$r=PNO(J
 print("</caption>");
print("</TABLE>");
 
//$B7k2L%l%3!<%I$r%a%b%j$+$i3+J|(J
mysql_free_result($rs);
 
//DB$B$X$N@\B3$r@ZCG(J
mysql_close($dbHandle);
 
//HTML$BJ8$r=PNO!!(Jjavascript$B$r;HMQ$7$FD>A0$N%Z!<%8$KLa$k%j%s%/(J
print ("<br><a href='kennsaku.php'>$BLa$k(J</a><br>");
 
//HTML$BJ8$r=PNO!!(JBODY$B$N=*N;(J
print("</BODY>\n");
 
//HTML$BJ8$r=PNO!!(JHTML$B$N=*N;(J
print("</HTML>\n");
?>
 
$B!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v(J

女の子お絵かき掲示板ナスカiPhone修理