Skip to content

Instantly share code, notes, and snippets.

View KimiyukiYamauchi's full-sized avatar

Kimiyuki Yamauchi KimiyukiYamauchi

View GitHub Profile
<?php
// 出力形式、文字コードの指定
header('Content-type: text/html; charset=UTF-8');
// 必要パッケージの読み込み
require_once('jpgraph/jpgraph.php');
require_once('jpgraph/jpgraph_bar.php');
// データの設定
$datax=array();
<?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 include("common2.php"); ?>
<?php include("formhelpers.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title>ひよこ掲示板 </title>
<meta charset="utf8">
<style>
body {
background-color: #f0e6ac;
drop table if exists bbs;
create table bbs
(post_id int primary key,
name varchar(20) ,
comment varchar(400),
time datetime
) engine=innodb;
<?php
// Load the form helper functions.
require 'formhelpers.php';
// 部門番号の選択
$deptno_choices = array();
$dsn = 'mysql:dbname=testphp;host=localhost';
$user = 'test';
$password = 'pass';
try{
<?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';
$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';
$db = mysqli_connect('localhost','test','pass','testphp');
if (! $db) { die("Can't connect: " . mysqli_connect_error()); }
// 部門番号の選択
$deptno_choices = array();
<?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 PEAR MDB2
require 'MDB2.php';
// Load the form helper functions.
require 'formhelpers.php';
require 'connect_mysql.php';
// Connect to the database