PHP
PHP入門
Use the <span> tag for inline styling, or <table> for tabular data. <table class="table table-bordered"> <thead> <tr> <th>Header 1</th> </tr> </thead> </table> session_start() セッションを開始します。 prepare() SQLインジェクション対策のためのプリペアドステートメントです。 fetch() 取得したユーザー情報を配列として取得します。 コード 説明 session_start() セッションを開始する $_POST['email'] フォームから送信されたメールアドレスを取得 prepare() SQL文を事前準備する execute() SQLを実行する fetch() 1件のデータを取得する コード PHP コード 説明 session_start() セッションを開始する $_POST['email'] フォームから送信されたメールアドレスを取得 prepare() SQL文を事前準備する execute() SQLを実行する fetch() 1件のデータを取得する PHPログインコード <?php session_start(); $pdo = new PDO("mysql:host=localhost;dbname=test;charset=utf8","root",""); $email = $_POST['email']; $password = $_POST['password']; $stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { $_SESSION['user_id'] = $user['id']; echo "ログイン成功"; } else { echo "ログイン失敗"; } ?> Tag Description <code> Styles inline snippets of code. <pre> Defines preformatted, scrollable code blocks. <span> An inline container used to mark up a part of a text. code_here
MySQL基礎
const message = "Hello World"; console.log(message); const example = "Hello World"; 項目 値 OS Ubuntu Version 24.04 sudo apt update sudo apt upgrade -y sudo reboot Warning card ファイル構成 google-auth/ ├── composer.json ├── composer.lock ├── config.php ├── google-callback.php ├── index.php ├── login.php ├── logout.php └── vendor/ .code-box{ border: 1px solid #dee2e6; border-radius: .375rem; padding: 1rem; background: #f8f9fa; }