-2

getTierOne() works fine with PHP 5.6 but not with PHP7.4 and the javascript keep running none stop (loop). Where am i getting it wrong? i want to migrate from PHP5 to PHP7. below is the line of code.

$sql = "SELECT * FROM year order by year, year_value"; 
$query = mysqli_query($conn, $sql) or die(mysqli_error());

while($tier = mysqli_fetch_array( $query )) 

    {
       echo '<option 
  value="'.$tier['year_value'].'">'.$tier['year_desc'].'</option>';
    }

}

 //**************************************
 //     First selection results     //
 //**************************************
if($_GET['func'] == "drop_1" && isset($_GET['func'])) { 
 drop_1($_GET['drop_var']); 
}

function drop_1($drop_var)
{  
$temp_var1 = $drop_var[1];
$temp_var2 = $drop_var[2];

if(strlen($drop_var)>3){
    $temp_var1 = $drop_var[1].$drop_var[2];
    $temp_var2 = $drop_var[3];
}
James Z
  • 12,104
  • 10
  • 27
  • 43
  • `mysql_` extension __does not__ exist in php7 – u_mulder Jun 04 '22 at 18:58
  • 2
    Where is the code for `getTierOne`? What does it mean "it doesn't work". – Dharman Jun 04 '22 at 19:16
  • You have an error. [`mysqli_error()`](https://www.php.net/manual/en/mysqli.error.php) needs one argument. Please consider switching error mode on instead. [How to get the error message in MySQLi?](https://stackoverflow.com/a/22662582/1839439) – Dharman Jun 04 '22 at 19:16
  • mysql_ extension does not exist in php7 I am sorry i posted the mysql extension for PHP 5. I have edited the code to mysqli_ extension for PHP 7 – Onos Ufuoma Jun 04 '22 at 19:21
  • (THIS WEBPAGE SIDE OF THE FUNCTION getTierOne) Year Please Wait – Onos Ufuoma Jun 04 '22 at 23:51

0 Answers0