WMA4 all midterms

5.0(2)
studied byStudied by 39 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/78

flashcard set

Earn XP

Description and Tags

lahat na sa wma4

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

79 Terms

1
New cards

PHP

is a recursive acronym for “_____: Hypertext Preprocessor”

2
New cards

PHP

It is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

3
New cards

PHP

-is a server-side scripting language

-scripts are executed on the server

-supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)

-is open source software

-is free to download and use

4
New cards

PHP

-runs on different platforms (Windows, Linux, Unix, etc.)

-is compatible with almost all servers used today (Apache, IIS, etc.) >

-is FREE to download from the official PHP resource: www.php.net >

-is easy to learn and runs efficiently on the server side

5
New cards

MySQL

is a database server

is ideal for both small and large applications

supports standard SQL

compiles on a number of platforms

is free to download and use

6
New cards

<?php and ?> 

The PHP code is enclosed in special start and end processing instructions

7
New cards

server

PHP code is executed on the?

8
New cards

PHP echo() statement.

This program is extremely simple and you really did not need to use PHP to create a page like this. All it does is display: Hello World using the?

<p>This program is extremely simple and you really did not need to use PHP to create a page like this. All it does is display: Hello World using the?</p>
9
New cards

//

In PHP, we use ____ to make a single-line comment

10
New cards
<p>/* “comment inside” *</p>

/* “comment inside” *

In PHP, we use ____ to make a large comment

11
New cards

Variables

are used for storing values, like text strings, numbers or arrays.

12
New cards
<p>$</p>

$

All variables in PHP start with a ___ sign symbol

13
New cards
<p>The concatenation operator (.)</p>

The concatenation operator (.)

is used to put two string values together.

14
New cards

1. Arithmetic

2. Assignment

3. Comparison

4. Logical

There are four classifications of operators:

15
New cards

if statement

use this statement to execute some code only if a specified condition is true

16
New cards

if…else statement

use this statement to execute some code if a condition is true and another code if the condition is false

17
New cards

if...elseif....else statement

use this statement to select one of several blocks of code to be executed

18
New cards

switch statement

use this statement to select one of many blocks of code to be executed

19
New cards

curly braces { }

If more than one line should be executed if a condition is true/false, the lines should be enclosed within?

20
New cards

break

Use _______ to prevent the code from running into the next case automatically.

21
New cards

array variable

is a storage area holding a number or text.

22
New cards

array

is a special variable, which can store multiple values in one single variable.

23
New cards
  1. Numeric array

  2. Associative array

  3. Multidimensional array

In PHP, there are three kind of arrays:

24
New cards

Numeric array

An array with a numeric index

25
New cards

Associative array

An array where each ID key is associated with a value

26
New cards

Multidimensional array

An array containing one or more arrays

27
New cards
<p>numeric array</p>

numeric array

stores each array element with a numeric index.

28
New cards
<p>associative array</p>

associative array

each ID key is associated with a value.

29
New cards
<p>multidimensional array</p>

multidimensional array

each element in the main array can also be an array.

30
New cards

loops

Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal lines in a script we can use?

31
New cards
<p>while loop</p>

while loop

loops through a block of code while a specified condition is true

32
New cards
<p>do...while loop</p>

do...while loop

loops through a block of code once, and then repeats the loop as long as a specified condition is true

33
New cards
<p>for loop</p>

for loop

loops through a block of code a specified number of times

34
New cards
<p>foreach</p>

foreach

loops through a block of code for each element in an array

35
New cards
  1. init

  2. condition

  3. increment

PHP Loops - For Parameters (3):

36
New cards

init

Mostly used to set a counter (but can be any code to be executed once at the beginning of the loop)

37
New cards

condition

Evaluated for each loop iteration. If it evaluates to TRUE, the loop continues. If it evaluates to FALSE, the loop ends.

38
New cards

increment

Mostly used to increment a counter (but can be any code to be executed at the end of the loop)

39
New cards

function (parang method sa java ata i2 eh)

To keep the script from being executed when the page loads, you can put it into a

40
New cards
<p>function</p>

function

will be executed by a call to the function.

41
New cards
<p>parameters</p>

parameters

To add more functionality to a function, we can add

42
New cards

$_GET function

is used to collect values from a form sent with method="get".

43
New cards
<p>$_POST function</p>

$_POST function

is used to collect values from a form sent with method="post".

44
New cards

8

However, there is an ___ Mb max size for the POST method, by default (can be changed by setting the post_max_size in the php.ini file).

45
New cards

htmlspecialchars()

makes sure any characters that are special in html are properly encoded so people can't inject HTML tags or Javascript into your page.

46
New cards

POST

Information sent from a form with the _______ method is invisible to others and has no limits on the amount of information to send

47
New cards

MySQL

is a very popular, open source database.

48
New cards

MySQL

provides an interactive shell for creating tables, inserting data, etc.

49
New cards

\c

If you decide you don't want to execute a command that you are in the process of entering, cancel it by typing

50
New cards
<p>SHOW</p>

SHOW

Use the _____ statement to find out which databases currently exist on the server

51
New cards
<p><span style="font-family: Arial">create database</span></p>

create database

To create a new database, issue the ____ _____ command:

52
New cards
<p>use</p>

use

§To the select a database, issue the “____” command

53
New cards
<p>empty set</p>

empty set

indicates that I have not created any tables yet.

54
New cards
<p>show tables;</p>

show tables;

Once you have selected a database, you can view all database tables using the what command?

55
New cards

VARCHAR

Is usually used to store string data.

56
New cards
<p>CREATE TABLE</p>

CREATE TABLE

To create a table, use the _______ ______ command:

57
New cards
<p>show tables;</p>

show tables;

To verify that the table has been created:

58
New cards
<p>DESCRIBE</p>

DESCRIBE

To view a table structure, use the ___________ command:

59
New cards
<p>DROP TABLE</p>

DROP TABLE

To delete an entire table, use the ______ _____ command:

60
New cards
<p><span style="font-family: Arial">INSERT </span></p>

INSERT

Use the ________ statement to enter data into a table.

61
New cards
<p><span style="font-family: Arial">SELECT </span></p>

SELECT

The _______ statement is used to pull information from a table.

62
New cards
<p><span style="font-family: Arial">SELECT </span></p>

SELECT

The simplest form of _______ retrieves everything from a table

63
New cards
<p><span style="font-family: Arial">ORDER BY</span></p>

ORDER BY

To sort a result, use an _____ ___ clause.

64
New cards
<p><span style="font-family: Arial">DESC</span></p>

DESC

To sort in reverse order, add the ?

65
New cards

NULL

means missing value or unknown value.

66
New cards

LIKE , NOT LIKE

To perform pattern matching, use the ____ or ____ _____ comparison operators

67
New cards
<p><span style="font-family: Arial">_</span></p>

_

Used to match any single character.

68
New cards
<p><span style="font-family: Arial">%</span></p>

%

Used to match an arbitrary number of characters.

69
New cards
term image

Reg Ex Example

70
New cards
term image

Reg Ex Example

71
New cards
<p><span style="font-family: Arial">COUNT()</span></p>

COUNT()

The _____ function counts the number of non-NULL results.

72
New cards

Retrieving Data

Chances are your application will spend the majority of its efforts retrieving and formatting requested data

73
New cards

mysqli extension

also offers the ability to manage result sets using both associative and indexed arrays using the fetch_array() and fetch_row() methods.

74
New cards

fetch_array() method

is actually capable of retrieving each row of the result set as an associative array, a numerically indexed array.

75
New cards

fetch_array()

retrieves both arrays; you can modify this default behavior by passing one of the following values in as the result type.

76
New cards
<p><span style="font-family: Franklin Gothic Book">MYSQLI_ASSOC</span></p>

MYSQLI_ASSOC

Returns the row as an associative array, with the key represented by the field name and the value by the field contents.

77
New cards
<p><span style="font-family: Franklin Gothic Book">MYSQLI_NUM</span></p>

MYSQLI_NUM

Returns the row as a numerically indexed array, with the ordering determined by the ordering of the field names as specified within the query

78
New cards
<p>INSERT INTO&nbsp;</p>

INSERT INTO 

is a statement that adds data to the specified MySQL database table

79
New cards
<p><span style="font-family: Franklin Gothic Book">num_rows() method</span></p>

num_rows() method

is useful when you want to learn how many rows have been returned from a SELECT query statement