WMA4 all midterms

studied byStudied by 39 people
5.0(2)
Get a hint
Hint

PHP

1 / 78

flashcard set

Earn XP

Description and Tags

lahat na sa wma4

79 Terms

1

PHP

is a recursive acronym for “_____: Hypertext Preprocessor”

New cards
2

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.

New cards
3

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

New cards
4

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

New cards
5

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

New cards
6

<?php and ?> 

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

New cards
7

server

PHP code is executed on the?

New cards
8

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>
New cards
9

//

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

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

/* “comment inside” *

In PHP, we use ____ to make a large comment

New cards
11

Variables

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

New cards
12
<p>$</p>

$

All variables in PHP start with a ___ sign symbol

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

The concatenation operator (.)

is used to put two string values together.

New cards
14

1. Arithmetic

2. Assignment

3. Comparison

4. Logical

There are four classifications of operators:

New cards
15

if statement

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

New cards
16

if…else statement

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

New cards
17

if...elseif....else statement

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

New cards
18

switch statement

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

New cards
19

curly braces { }

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

New cards
20

break

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

New cards
21

array variable

is a storage area holding a number or text.

New cards
22

array

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

New cards
23
  1. Numeric array

  2. Associative array

  3. Multidimensional array

In PHP, there are three kind of arrays:

New cards
24

Numeric array

An array with a numeric index

New cards
25

Associative array

An array where each ID key is associated with a value

New cards
26

Multidimensional array

An array containing one or more arrays

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

numeric array

stores each array element with a numeric index.

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

associative array

each ID key is associated with a value.

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

multidimensional array

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

New cards
30

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?

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

while loop

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

New cards
32
<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

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

for loop

loops through a block of code a specified number of times

New cards
34
<p>foreach</p>

foreach

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

New cards
35
  1. init

  2. condition

  3. increment

PHP Loops - For Parameters (3):

New cards
36

init

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

New cards
37

condition

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

New cards
38

increment

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

New cards
39

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

New cards
40
<p>function</p>

function

will be executed by a call to the function.

New cards
41
<p>parameters</p>

parameters

To add more functionality to a function, we can add

New cards
42

$_GET function

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

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

$_POST function

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

New cards
44

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).

New cards
45

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.

New cards
46

POST

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

New cards
47

MySQL

is a very popular, open source database.

New cards
48

MySQL

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

New cards
49

\c

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

New cards
50
<p>SHOW</p>

SHOW

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

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

create database

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

New cards
52
<p>use</p>

use

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

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

empty set

indicates that I have not created any tables yet.

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

show tables;

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

New cards
55

VARCHAR

Is usually used to store string data.

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

CREATE TABLE

To create a table, use the _______ ______ command:

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

show tables;

To verify that the table has been created:

New cards
58
<p>DESCRIBE</p>

DESCRIBE

To view a table structure, use the ___________ command:

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

DROP TABLE

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

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

INSERT

Use the ________ statement to enter data into a table.

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

SELECT

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

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

SELECT

The simplest form of _______ retrieves everything from a table

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

ORDER BY

To sort a result, use an _____ ___ clause.

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

DESC

To sort in reverse order, add the ?

New cards
65

NULL

means missing value or unknown value.

New cards
66

LIKE , NOT LIKE

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

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

_

Used to match any single character.

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

%

Used to match an arbitrary number of characters.

New cards
69
term image

Reg Ex Example

New cards
70
term image

Reg Ex Example

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

COUNT()

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

New cards
72

Retrieving Data

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

New cards
73

mysqli extension

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

New cards
74

fetch_array() method

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

New cards
75

fetch_array()

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

New cards
76
<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.

New cards
77
<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

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

INSERT INTO 

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

New cards
79
<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

New cards

Explore top notes

note Note
studied byStudied by 2220 people
... ago
4.7(3)
note Note
studied byStudied by 24 people
... ago
5.0(1)
note Note
studied byStudied by 42 people
... ago
5.0(2)
note Note
studied byStudied by 48 people
... ago
5.0(1)
note Note
studied byStudied by 452 people
... ago
5.0(3)
note Note
studied byStudied by 43 people
... ago
5.0(1)
note Note
studied byStudied by 19 people
... ago
4.5(2)
note Note
studied byStudied by 23406 people
... ago
4.5(119)

Explore top flashcards

flashcards Flashcard (41)
studied byStudied by 2 people
... ago
4.0(1)
flashcards Flashcard (26)
studied byStudied by 173 people
... ago
5.0(1)
flashcards Flashcard (48)
studied byStudied by 21 people
... ago
5.0(1)
flashcards Flashcard (41)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (47)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (22)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (22)
studied byStudied by 3 people
... ago
5.0(1)
robot