Connection failed: could not find driver

PHP development


Lesson 8

HTML structure


<!-DOCTYPE html>
<html>
<head>
    <title>Lesson 8</title>
    <link rel="stylesheet" href="/css/general.css" media="all">
    <link rel="stylesheet" href="/css/menu.css" media="all">
</head>
<body>

</body>
</html>


DOCTYPE is used to show what html version should be used to render the page. if no DOCTYPE is used the browser will use 'quirks mode' https://en.wikipedia.org/wiki/Quirks_mode

Tables


<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
  <tr>
    <td>Centro comercial Moctezuma</td>
    <td>Francisco Chang</td>
    <td>Mexico</td>
  </tr>
</table> 
Company Contact Country
Alfreds Futterkiste Maria Anders Germany
Centro comercial Moctezuma Francisco Chang Mexico

PHP function switch()

de switch() function works more or less like the if else structure. It takes an argument and depending of its value it will do something.


$var = 10;

if ( $var == 10 ) {
    echo 'Exactly 10';
} else {
    echo 'NOt 10';
} 
	

switch($var){
    case 10: 
        echo 'Exactly 10';
        break;
    default: 
        echo 'NOT 10';
        break;
}


switch($beer)
{
    case 'tuborg';
    case 'carlsberg';
    case 'stella';
    case 'heineken';
        echo 'Good choice';
        break;
    default;
        echo 'Please make a new selection...';
        break;
}

if ( $beer == 'tuborg' || 
     $beer == 'carlsberg' || 
     $beer == 'stella' || 
     $beer == 'heineken' ) {
    echo 'Good choice';
} else
    echo 'Please make a new selection...';
}