Sql select

sql select SELECT * FROM table_name; sql select select [all/distinct] <col1>, <col2>, <col3> from <table_name> [join <join_condition>] [where <condition>] [group by <column_name>] [having <search_condition>] [order by <sort_specification>] /* Specifically for SQL -> Oracle LEGEND: […] : optional entries <…> : your specific entry */</sort_specification></search_condition></column_name></condition></join_condition></table_name></col3></col2></col1> sql select SELECT * FROM TABLE_NAME; sql select SELECT * FROM […]

Sql select Read More

Sql insert multiple rows

SQL Insert Multiple Rows INSERT INTO StudentTable ( Rollo, Name, Class, Contact ) VALUES ( ‘1’, ‘Jonny’, ’10th’, ‘9856245’ ), ( ‘2’, ‘Ronny’, ’12th’, ‘5421545’ ); sql server insert multiple rows INSERT INTO table_name (column_list) VALUES     (value_list_1),     (value_list_2),     …     (value_list_n);

Sql insert multiple rows Read More

Sql injection

sql injection ” or “”=” sql injection attack $value = “your value here”; try { $pdo = new PDO($dsn, $username, $password, $>drivers); } catch (\PDOException $e) { echo ‘Connection Failed: ‘ . $e->getMessage(); } $sql = “INSERT INTO `my_db` SET `field` = ? “; $stmt = $this->pdo->prepare($sql); $stmt->bindValue(1, $value, PDO::PARAM_STR); $stmt->execute(); $stmt = null; mitigation […]

Sql injection Read More

Sql date functions

sql date functions ADDDATE Add a date interval (eg: 10 DAY) to a date (eg: 20/01/20) and return the result (eg: 20/01/30). ADDTIME Add a time interval (eg: 02:00) to a time or datetime (05:00) and return the result (07:00). CURDATE Get the current date. CURRENT_DATE Same as CURDATE. CURRENT_TIME Get the current time. CURRENT_ […]

Sql date functions Read More