Sõnastik

Tag: PhP

$_POST (PhP) – $_POST – used to collect data sent via an HTML form using method=”post”. Example: $name = $_POST[name];
$_REQUEST (PhP) – $_REQUEST – collects data from $_GET, $_POST and $_COOKIE. Example: $id = $_REQUEST[’id’];
Bind_param (PhP) – bind_param() – binds variables to the SQL query parameters. Example: $stmt->bind_param(“i”, $id);
Bind_result (PhP) – bind_result() – binds result columns to PHP variables. Example: $stmt->bind_result($name, $email);
Echo (PhP) – echo – outputs text or variable values to the browser. Example : echo “Tere maailm!“; or echo (“Tere maailm!”);
Execute (PhP) – execute() – executes the prepared SQL statement. Example: $stmt->execute();
Fetch (PhP) – fetch() – fetches the result row by row. Example: $stmt->fetch();
Include (PhP) – include() – Includes a file, but the script continues even if the file is not found. Example: include(“header.php”);
New mysqli (PhP) – new mysqli(hostname, username, password, database) – creates a connection to a MySQL database. Example: $connect = new mysqli(“localhost”, “user”, “password”, “db_name”);
Prepare (PhP) – prepare() – prepares an SQL query for safe execution. Example: $stmt = $connect->prepare(“SELECT * FROM users WHERE id = ?); * – columns users – table name
1 2