This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func select(){ | |
let sql2: String = "select * from koko" | |
let (resultSet, err) = SD.executeQuery(sql2) | |
if err != nil { | |
println("error") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if let err = SD.createTable( "koko", | |
withColumnNamesAndTypes: [ | |
"id2": .StringVal, | |
"web": .StringVal, | |
"toki": .DataVal, | |
]){ | |
println("テーブルは既に存在しています!") | |
}else{ | |
println("テーブルを作成しました!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mysql_connect('localhost', 'root', 'root') or die(mysql_error()); | |
echo 'database connected'; | |
mysql_select_db('shop_sample') or die(mysql_error()); | |
echo '<br />Database shop_sample selected'; | |
mysql_query('SET NAMES UTF8'); | |
$name = $_POST['name']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mysql_connect('localhost', 'root', 'root') or die(mysql_error()); | |
echo 'database connected'; | |
mysql_select_db('shop_sample') or die(mysql_error()); | |
echo '<br />Database shop_sample selected'; | |
mysql_query('SET NAMES UTF8'); | |
$name = $_POST['name']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Construct url object via string | |
var url = NSURL(string: "http://localhost/json/json_test.php") | |
let config = NSURLSessionConfiguration.defaultSessionConfiguration() | |
let session = NSURLSession(configuration: config) | |
var req = NSMutableURLRequest(URL: url!) | |
var json:NSData! | |
//今後動的にすることを想定 | |
let hoge:String = "hogehogehoge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mysql_connect('localhost', 'root', 'root') or die(mysql_error()); | |
echo 'database connected'; | |
mysql_select_db('shop_sample') or die(mysql_error()); | |
echo '<br />Database shop_sample selected'; | |
mysql_query('SET NAMES UTF8'); | |
$name = $_POST['name']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = NSURL(string: "http://localhost/json/php_MySQL.php") | |
let config = NSURLSessionConfiguration.defaultSessionConfiguration() | |
let session = NSURLSession(configuration: config) | |
var req = NSMutableURLRequest(URL: url!) | |
req.HTTPMethod = "POST" | |
req.HTTPBody = "id=13&name=Jack".dataUsingEncoding(NSUTF8StringEncoding) | |
var task = session.dataTaskWithRequest(req, completionHandler: { | |
(data, resp, err) in | |
println(resp.URL!) | |
println(NSString(data: data, encoding: NSUTF8StringEncoding)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$myId = $_POST['my_id']; | |
$password = $_POST['password']; | |
$save = $_POST['save']; | |
//Cookieに保存 | |
if ($save == 'on'){ | |
setcookie('my_id', $myId, time() + 60 * 60 * 24 * 14); | |
$message = 'login info registered'; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_COOKIE['my_id'])) { | |
$myId = $_COOKIE['my_id']; | |
} else { | |
$myId = ''; | |
} | |
?> | |
<form action="cookie_sample2.php" method="post"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Interval = NSDate() | |
var Time = NSDate().timeIntervalSinceDate(Interval) | |
println(Time) |
NewerOlder