Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP JS cheat sheet
- =====JS:
- var input = document.getElementById("inputVal").value;
- document.getElementById("").innerHTML = " " + String(input) ;
- ========= PHP
- include("");
- session_start();
- isset($_POST[''])
- unsset($_POST[''])
- $_SESSION['']
- $GLOBALS['']
- $_SESSION[''] = base64_encode(openssl_random_pseudo_bytes(32));
- ============= PHP mysqli
- == db login var:
- $dbIP =
- $dbName =
- $dbuser=
- $dbpass=
- == How query look like:
- $mysqli = new mysqli($GLOBALS['dbIP'],$GLOBALS['dbuser'], $GLOBALS['dbpass'], $GLOBALS['dbName']);
- $query = "";
- $mysqli->query($query);
- $mysqli->close();
- == while using update/insert/delete statment:
- $mysqli->affected_rows > 0
- == while using select:
- $query = "";
- $mysqli->query($query);
- $result->num_rows
- == While getting the first row match:
- (string)$result->fetch_row()[0];
- == print the hole answer:
- if($result = $mysqli->query($query)){
- while ($row = $result->fetch_assoc()) {
- printf ("(%s) %s </br>", $row["username"], $row["comment"] );
- }
- }
Add Comment
Please, Sign In to add comment