PHP Flashcards
1
Q
Assign variable using the HTML form data
A
$VariableName1 = $_POST/GET [‘FormFieldName’]; %VariableName2 = $_POST/GET [‘FormFieldName’]
2
Q
Connection Parameters
A
$dbserver = ‘ServerName’; $dbuser = ‘Username’; $dbpass = ‘Password’; $dbname = ‘DatabaseName’;
3
Q
Selection of database
A
$connection = mysql_connect($dbserver, $dbuser, $dbpass);
mysql_select_db($dbname, $connection);
4
Q
Execute Query
A
$result = mysql_query(SELECT * FROM tableName WHERE $VariableName2 LIKE ‘%$$VariableName1%’)
5
Q
close connection
A
mysql_close(connection);