A hand crafted markdown document contains all major Javascript topics covered, taken from different sources. Brush Up your JS memory.
Single line comments start with //. For multi-line commands, you use /* ... */
// This is a single line comment| <?php | |
| ob_start(); | |
| include('../db_config.php'); | |
| $db = database::getInstance(); | |
| $sql = "SELECT * FROM computer"; | |
| $result = $db->dbc->query($sql); | |
| $count = $result->rowCount(); | |
| ?> |
| <?php | |
| ob_start(); | |
| include('../db_config.php'); | |
| $db = database::getInstance(); | |
| $sql = "SELECT * FROM computer"; | |
| $result = $db->dbc->query($sql); | |
| $count = $result->rowCount(); | |
| ?> |
| <?php | |
| if(isset($_POST['Submit'])){ | |
| for($i=0;$i<$count;$i++){ | |
| $name = $_POST['name']; | |
| $f_name = $_POST['lastname']; | |
| $m_name = $_POST['email']; | |
| // This is a query for uploading multiple values in single query. | |
| $sql1="UPDATE computer SET s_name='$name[$i]', f_name='$f_name[$i]', m_name='$m_name[$i]' WHERE roll='$id[$i]'"; |
| <?php | |
| SET @sql = NULL; | |
| SELECT | |
| GROUP_CONCAT(DISTINCT | |
| CONCAT( | |
| 'max(CASE WHEN ca.date = ''', | |
| date_format(date, '%Y-%m-%d'), | |
| ''' THEN coalesce(p.status, ''P'') END) AS `', | |
| date_format(date, '%Y-%m-%d'), '`' | |
| ) |
| <?php foreach ($result as $row) { | |
| $value1 = strpos($row['c_main_title'], $searchValue) !== FALSE; | |
| $value2 = strpos($row['c_main_body'], $searchValue) !== FALSE; | |
| $value3 = strpos($row['cmt_dept_title'], $searchValue) !== FALSE; | |
| $value4 = strpos($row['cmt_dept_body'], $searchValue) !== FALSE; | |
| $value5 = strpos($row['aidt_dept_title'], $searchValue) !== FALSE; | |
| $value6 = strpos($row['aidt_dept_body'], $searchValue) !== FALSE; | |
| $value7 = strpos($row['food_dept_title'], $searchValue) !== FALSE; | |
| $value8 = strpos($row['food_dept_body'], $searchValue) !== FALSE; | |
| $value9 = strpos($row['rac_dept_title'], $searchValue) !== FALSE; |
| <?php | |
| if(isset($_GET['submit_value']) && !empty($_GET['search_input'])) | |
| { | |
| include("db_config.php"); | |
| $db = database::getInstance(); | |
| $searchValue = $_GET['search_input']; | |
| $sql = "SELECT * FROM `sitedata` WHERE c_main_title LIKE '%$searchValue%' OR c_main_body LIKE '%$searchValue%' OR cmt_dept_title LIKE '%$searchValue%' OR cmt_dept_body LIKE '%$searchValue%' | |
| OR aidt_dept_title LIKE '%$searchValue%' OR aidt_dept_body LIKE '%$searchValue%' OR food_dept_title LIKE '%$searchValue%' OR food_dept_body LIKE '%$searchValue%' OR rac_dept_title LIKE '%$searchValue%' |