3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bdd = mysqli_connect('localhost', 'root', '', 'webpage'); $stmt_1 = mysqli_stmt_init($bdd); // SELECTING DISCOUNT , DATES , ROOMS TYPE , MIN STAY $num = 0; mysqli_set_charset ( $bdd , 'utf8' ); if (mysqli_stmt_prepare($stmt_1, 'SELECT num , date , offer , title , from , to , discount , min_days , roomtype_1, roomtype_2, roomtype_3, roomtype_4, roomtype_5, roomtype_6, roomtype_7 FROM promot WHERE num= ?')) { mysqli_stmt_bind_param ($stmt_1 , "i", $num ); mysqli_stmt_execute ($stmt_1); mysqli_stmt_store_result($stmt_1); mysqli_stmt_bind_result ($stmt_1, $num , $date , $offer , $title , $from , $to , $discount , $min_days , $roomtype_1 , $roomtype_2 , $roomtype_3 , $roomtype_4 , $roomtype_5 , $roomtype_6 , $roomtype_7); mysqli_stmt_fetch ($stmt_1); mysqli_stmt_close ($stmt_1); $size = 120 ; $start = 0 ; $text = utf8_encode( substr ( $offer , $start , $size )); $title = utf8_encode( $title ) ; if ( $from == NULL && $to == NULL ) { echo "<div id='of'>".$title."<a href='index.php?page=offer'>".$text."</a></div>"; } else { // SELECTING ROOM NAMES $roomNames = ''; $room = array ( $roomtype_ , $roomtype_2, $roomtype_3, $roomtype_4, $roomtype_5, $roomtype_6, $roomtype_7 ); foreach ( $room as $roomtype => $value ) { if ( $value == 'yes' ) { $roomt = 'roomtype_'.($roomtype+1); $stmt_2 = mysqli_stmt_init ($bdd); mysqli_stmt_prepare ($stmt_2, 'SELECT room_name FROM pic_habitacio WHERE roomtype_x = ?'); mysqli_stmt_bind_param ($stmt_2); mysqli_stmt_execute ($stmt_2); **mysqli_stmt_bind_result($stmt_2, $data['room_name'][$roomt] );** mysqli_stmt_fetch ($stmt_2); $roomNames.='<br />'.$data["room_name"][$roomt]; } } $offer = $title.'<a class="text_d_none" href="index.php?page=offer">Desde el '.$from.' hasta el '.$to.' descuento'.$discount.' % sobre toda estancia de mínimo '.$min_days.' días en las habitaciones de tipo ... </a>'; $_SESSION['offer'] = $offer; $text = ( substr ($offer , $start , $size )); echo '<div id="of">'.$offer.'</div>'; } }
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected '*' in /in/WlgTh on line 38
Process exited with code 255.