U E D R , A S I H C RSS

2010php/방명록만들기 (rev. 1.3)

2010php/방명록만들기

<?php
$link = mysql_connect('mysql5.hosting.paran.com', 'linflus', '');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}else{
    echo("Connect Succesful.<br/>");
}

$db = mysql_select_db("linflus_db");
/*
$sql = "CREATE TABLE guest
    (no integer not null,
    name    char(10),
    contents    text(2000),
    password    char(4),
    status  integer,
    date    date)";

$result = mysql_query($sql);

if(!$result){
    die('Can not create table');
}else{
    echo($result);
}
*/

$sql = "INSERT INTO guest
    values(1, 'ksh', 'hello', '1234', 1)";
$result = mysql_query($sql);

$sql = "SELECT * FROM guest";
$result = mysql_query($sql);
$obj = mysql_fetch_object($result);

echo($obj->name);
?>
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:11
Processing time 0.0129 sec