+++ .idea/dataSources.xml
... | ... | @@ -0,0 +1,12 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project version="4"> | |
3 | + <component name="DataSourceManagerImpl" format="xml" multifile-model="true"> | |
4 | + <data-source source="LOCAL" name="study@localhost" uuid="e3bdc062-9810-49e5-a08b-3bd9c11bcce0"> | |
5 | + <driver-ref>mariadb</driver-ref> | |
6 | + <synchronize>true</synchronize> | |
7 | + <jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver> | |
8 | + <jdbc-url>jdbc:mariadb://localhost:3306/study</jdbc-url> | |
9 | + <working-dir>$ProjectFileDir$</working-dir> | |
10 | + </data-source> | |
11 | + </component> | |
12 | +</project>(No newline at end of file) |
+++ 20220126/dbtest.php
... | ... | @@ -0,0 +1,45 @@ |
1 | +<?php | |
2 | + $user = "root"; | |
3 | + $password = "1234"; | |
4 | + $option = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); | |
5 | + | |
6 | + /* Try Catch */ | |
7 | + try { | |
8 | + /* PDO Connection */ | |
9 | + $db = new PDO("mysql:host=localhost;dbname=study", $user, $password, $option); | |
10 | + $db->exec("set names UTF8"); | |
11 | + echo "<strong>Database Connection Success!!!</strong><br>"; | |
12 | + } catch (PDOException $e) { | |
13 | + echo "<strong>Database Connection Fail!!!</strong>"; | |
14 | + echo "<br>" . $e; | |
15 | + } finally { | |
16 | + | |
17 | + } | |
18 | + | |
19 | + /* Statement */ | |
20 | + $stmt = $db->query("select * from address"); | |
21 | + | |
22 | + /* Query RUN, Result GET */ | |
23 | + $result = $stmt->fetchAll(); | |
24 | + | |
25 | + foreach ($result as $value) { | |
26 | + echo "AGE : " . $value["age"] . "<br>"; | |
27 | + } | |
28 | + | |
29 | + /* INSERT */ | |
30 | +// $stmt = $db -> query("insert into address values(NULL, '임효원', 28, '010-5489-5486', '강원', '1665-12-15')"); | |
31 | +// $result = $stmt->execute(); | |
32 | + | |
33 | + /* UPDATE */ | |
34 | + $stmt = $db -> query("update address set name='안효원' where name='황동재'"); | |
35 | + $result = $stmt->execute(); | |
36 | + | |
37 | + | |
38 | + | |
39 | + | |
40 | + | |
41 | + | |
42 | + | |
43 | + | |
44 | + | |
45 | + |
--- form.php
... | ... | @@ -1,19 +0,0 @@ |
1 | -<!doctype html> | |
2 | -<html lang="ko"> | |
3 | -<head> | |
4 | - <meta charset="UTF-8"> | |
5 | - <meta name="viewport" | |
6 | - content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
7 | - <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
8 | - <title>form</title> | |
9 | -</head> | |
10 | -<body> | |
11 | - <h3>Get/Post</h3> | |
12 | - <form action="post.php" method="post"> | |
13 | - ID : <input type="text" name="id"><br> | |
14 | - P/W : <input type="password" name="pw"> | |
15 | - <input type="submit" value="POST"> | |
16 | - <a href="get.php?id=<?php echo $_GET["id"] ?>&pw=<?php echo $_GET["pw"] ?>">GET</a> | |
17 | - </form> | |
18 | -</body> | |
19 | -</html>(No newline at end of file) |
--- for.php
+++ form/for.php
No changes |
--- for_table.php
+++ form/for_table.php
No changes |
+++ form/form.php
... | ... | @@ -0,0 +1,0 @@ |
--- form_1.php
+++ form/form_1.php
No changes |
--- form_1_receive.php
+++ form/form_1_receive.php
No changes |
--- form_2.php
+++ form/form_2.php
No changes |
--- form_2.receive.php
+++ form/form_2.receive.php
No changes |
--- form_3.php
+++ form/form_3.php
No changes |
--- form_3.receive.php
+++ form/form_3.receive.php
No changes |
--- form_calc.php
+++ form/form_calc.php
No changes |
--- form_calc_receive.php
+++ form/form_calc_receive.php
No changes |
--- form_calc_server.php
+++ form/form_calc_server.php
No changes |
--- get.php
+++ form/get.php
No changes |
--- gugudan.php
+++ form/gugudan.php
No changes |
--- hello.php
+++ form/hello.php
No changes |
--- if.php
+++ form/if.php
No changes |
--- post.php
+++ form/post.php
No changes |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?