Sql Flashcards

1
Q

How to start a PHP session

A

session.start();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to stop a PHP session

A

session.destroy();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you create a SQL connection

A

$con = mysqli_connect($server,$username,$password,$database);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you stop a PHP script

A

die();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you display text

A

echo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you terminate a SQL connection

A

Mysqli_close($con);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you get the results from an SQL query

A

$result = mysqli_query($con,$sql);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you get the number of rows in the result

A

$row = mysqli_num_rows($results);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you get the results as an array

A

$row = mysqli_fetch_array($results);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is an if statement written

A

If (condition) { code to be executed}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is a if elif else statement written

A
if(condition) {code} 
else if(condition) {code}
else {code}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

While loops

A

while(condition){code}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

For loop

A

for($x = 0, $x<=10, $x++){code}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Return X then increment

A

$x++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Increment then return x

A

++$x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Return X then decrement

A

$x–

17
Q

Decrement X then return

A

–$x

18
Q

How do you define a function

A

Function name(variables) {code}

19
Q

How do you call a function called test

A

test();

20
Q

How to create an array

A

$a = array(values);