Mistři v programování na #hovnokod

<?php

$res = $my->query("SELECT * FROM `stats`");
$b = $res->fetch_object();

$res2 = $my->query("SELECT * FROM `stats2`");
$a = $res2->fetch_object();


?>




<table cellpadding="5" cellspacing = "3" border="4" width="20" 	height="20" bgcolor="white" bordercolor="black"> 

<tr>

   <td> Stránka </td>   <td> Zobrazení</td>     <td> Výpočtů </td>

</tr>


<tr>

   <td><?php echo $b->name; ?></td>   <td><?php echo $b->show; ?> </td>     <td> <?php echo $b->count ?></td>

</tr> 
</table>       </br>


<table cellpadding="5" cellspacing = "3" border="4" width="20" 	height="20" bgcolor="white" bordercolor="black"> 

<tr>

   <td> Stránka </td>   <td> Zobrazení</td>     

</tr>

   <?php while($a = $res2->fetch_object()) {   ?>
<tr>
    
   <td><?php echo $a->name; ?></td>   <td><?php echo $a->zob; ?> </td>     
  
</tr><?php } ?>  
</table>

Anonymous,


Anonymous,

Nesprávne umiestnená premenná

protected $fillable = [
	'price',
	'non_refundable',
	'room_id',
	//'flight_id',  what are you doing here?
	'has_event'
];

Anonymous,

Udajne to ma kontrolovat, zda zadany string je serializovany pomoci funkce serialize()... Nezbyva, nez tomu verit...

protected function isSerialized($value)
    {
        if (!is_string($value)) {
            return false;
        }

        if ($value === 'b:0;') {
            $result = false;
            return true;
        }

        $length = strlen($value);
        $end = '';

        switch ($value[0]) {
            case 's':
                if ($value[$length - 2] !== '"') {
                    return false;
                }
            case 'b':
            case 'i':
            case 'd':
                // This looks odd but it is quicker than isset()ing
                $end .= ';';
            case 'a':
            case 'O':
                $end .= '}';

                if ($value[1] !== ':') {
                    return false;
                }

                switch ($value[2]) {
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        break;

                    default:
                        return false;
                }
            case 'N':
                $end .= ';';

                if ($value[$length - 1] !== $end[0]) {
                    return false;
                }
                break;

            default:
                return false;
        }

        return true;
    }

Anonymous,

Jak správně zakomentovat obsah.

<?php if (0) { //schovani obsahu ----------------------------------------------------------------- ?>
	<div>Obsah</div>
<?php } //schovani obsahu ----------------------------------------------------------------- ?>

Anonymous,