What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-24 09:46:12
php mariadb connect
$host = 'localhost'; // URL to the server $user = 'root'; // Username (xampp = root) $pw = ''; // Password (xampp = ) $dbname = 'database'; // The name of your database $dsn = "mysql:host=$host;dbname=$dbname"; $options = [PDO::MYSQL_ATTR_INIT_... Add solution -
-
PHP 2021-10-14 19:36:09
return multiple rows from mysqli php and encode JSON
<?php $dashboard_content_token = $_REQUEST["dashboard_content_token"]; $token = "g4"; require(cc_scripts/connect.php); $sql = "SELECT * FROM `dashboard_content`"; $check = strcmp("$token", &... Add solution -
Other 2021-10-11 17:43:07
How to prevent sql Injection
// use prepared statement to prevent SQL injection $preparedStatement = $dbConnection->prepare('SELECT * FROM animals WHERE name = ?'); $preparedStatement->bind_param('s', $name); $preparedStatement->execute(); $result = $preparedStatement->... Add solution -
PHP 2021-10-08 15:48:04
bar chart in js,php
<?php include("db.php"); $query = "select jan,feb,march,april,may,june,july from saleschart"; $result = mysqli_query($conn,$query); if(mysqli_num_rows($result) >= 1) { while... Add solution -
PHP 2021-10-07 12:42:04
Daten Abfragen mit PHP aus MySQL Datenbank mysqli
<?php $mysqli = new mysqli("localhost", "user", "password", "database"); if ($mysqli->connect_errno) { die("Verbindung fehlgeschlagen: " . $mysqli->connect_error); } $id = ... Add solution