Skip to content

Instantly share code, notes, and snippets.

View KimiyukiYamauchi's full-sized avatar

Kimiyuki Yamauchi KimiyukiYamauchi

View GitHub Profile
<?php
// Load PEAR MDB2
require 'MDB2.php';
// Load the form helper functions.
require 'formhelpers.php';
require 'connect_mysql.php';
// Connect to the database
<?php
// Load the form helper functions.
require 'formhelpers.php';
$db = mysqli_connect('localhost','test','pass','testphp');
if (! $db) { die("Can't connect: " . mysqli_connect_error()); }
// 部門番号の選択
$deptno_choices = array();
<?php
// Load the form helper functions.
require 'formhelpers.php';
$db = mysqli_connect('localhost','test','pass','testphp');
if (! $db) { die("Can't connect: " . mysqli_connect_error()); }
// 部門番号の選択
$deptno_choices = array();
$sql = 'select deptno from departments order by deptno';
<?php
// Load the form helper functions.
require 'formhelpers.php';
// 部門番号の選択
$deptno_choices = array();
$dsn = 'mysql:dbname=testphp;host=localhost';
$user = 'test';
$password = 'pass';
<?php
// Load the form helper functions.
require 'formhelpers.php';
// 部門番号の選択
$deptno_choices = array();
$dsn = 'mysql:dbname=testphp;host=localhost';
$user = 'test';
$password = 'pass';
try{
drop table if exists bbs;
create table bbs
(post_id int primary key,
name varchar(20) ,
comment varchar(400),
time datetime
) engine=innodb;
<?php include("common2.php"); ?>
<?php include("formhelpers.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title>ひよこ掲示板 </title>
<meta charset="utf8">
<style>
body {
background-color: #f0e6ac;
<?php
// 日本語の文字コード設定などを予め定義
mb_internal_encoding("UTF-8");
mb_language("ja");
setlocale(LC_ALL,"ja_JP.UTF-8");
// csv
$bbs_file = "bbs.csv";
// エスケープを行うラップ関数を定義
function h($str) {
<?php
// 出力形式、文字コードの指定
header('Content-type: text/html; charset=UTF-8');
// 必要パッケージの読み込み
require_once('jpgraph/jpgraph.php');
require_once('jpgraph/jpgraph_bar.php');
// データの設定
$datax=array();
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0