{"id":809,"date":"2016-02-18T15:56:37","date_gmt":"2016-02-18T06:56:37","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=809"},"modified":"2016-02-18T15:56:37","modified_gmt":"2016-02-18T06:56:37","slug":"ugui%e3%81%ae%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%82%92sql%e3%81%a7%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%81%99%e3%82%8bphp","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=809","title":{"rendered":"UGUI\u306e\u30c6\u30ad\u30b9\u30c8\u3092SQL\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308bPHP"},"content":{"rendered":"<p>\u305d\u306e\u30e6\u30fc\u30b6\u540d\u304c\u5b58\u5728\u3059\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/p>\n<pre class=\"lang:php decode:true \">&lt;?php\r\n    \/\/ Send variables for the MySQL database class.\r\n    $database = mysql_connect('myserver.jp', 'username', 'passwd') or die('Could not connect: ' . mysql_error());\r\n    mysql_select_db('dbname') or die('Could not select database');\r\n\t\r\n\t\r\n\t\r\n\t\/\/\u5909\u6570\u5ba3\u8a00\r\n$keyword='';\t\/\/\u4e0d\u6b63\u9632\u6b62\u7528\u30ad\u30fc\u30ef\u30fc\u30c9\r\n$resultData='';\t\/\/\u8fd4\u3059\u30c7\u30fc\u30bf\r\n \r\n\/\/\u30c7\u30fc\u30bf\u53d7\u3051\u53d6\u308a\r\nif(isset($_POST['keyword'])){\r\n  $keyword=$_POST['keyword'];\t\/\/\u30ad\u30fc\u30ef\u30fc\u30c9\r\n  \r\n}\r\n\/\/print $_POST['keyword'];\r\n$name= $_POST['keyword'];\r\n\/\/print $name;\r\n\/\/if($keyword==null or !($keyword==$key['get_score_ranking'])){\r\n\/\/  $redirectUrl = \"http:\/\/filmm.info\/404.html\";\r\n\/\/  header(\"HTTP\/1.0 404 Not Found\");\r\n\/\/  print(file_get_contents($redirectUrl));\r\n\/\/  exit;\r\n\/\/}\r\n\r\n\r\n\r\n\/\/search test\r\n\t$nameresult = mysql_query(\"SELECT * FROM `scores` WHERE `name` = $name\");\/\/\u6587\u5b57\u5217\u691c\u7d22\u306f\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\r\nif (!$nameresult) {\r\n    die('\u30af\u30a8\u30ea\u30fc\u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002'.mysql_error());\r\n}\r\n\/\/echo mysql_num_rows($nameresult);\r\n\tprint mysql_num_rows($nameresult);\r\n\t\r\n?&gt;<\/pre>\n<p>\u304b\u306a\u308a\u4e0d\u8981\u90e8\u5206\u591a\u3057<\/p>\n<p>\u3061\u3087\u3063\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u306f\u826f\u304f\u306a\u3044\u90e8\u5206\u6709\u308a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\u30e6\u30fc\u30b6\u540d\u304c\u5b58\u5728\u3059\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b &lt;?php \/\/ Send variables for the MySQL database class. $database = mysql_connect(&#8216;myserve &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=809\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">UGUI\u306e\u30c6\u30ad\u30b9\u30c8\u3092SQL\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308bPHP<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,2],"tags":[],"class_list":["post-809","post","type-post","status-publish","format-standard","hentry","category-php","category-unity"],"_links":{"self":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=809"}],"version-history":[{"count":1,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/809\/revisions"}],"predecessor-version":[{"id":810,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/809\/revisions\/810"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}