I’ve been using php5 for years and had been holding off on upgrading to php7 as I knew it would be A LOT of work to convert all my code and I just didn’t have the time for it. Last week, however, I had some PC problems that forced me to upgrade my entire system and thus I’m now forced to work with php7. And so the nightmare I had anticipated begins…
So here’s one specific problem that has me banging my head against the wall.
This was my old php5 code:
$restit = mysql_db_query($base, "SELECT Title_col FROM tbl_Titles WHERE FilmID = '$id' AND Country_col = '$cnt' AND TitleType_col = '$type' "); while($row = mysql_fetch_object($restit)) $ftit = $row->Title_col; mysql_free_result($restit);
I converted that to this:
mysqli_select_db($db, $base); $restit = mysqli_query($db, "SELECT Title_col FROM tbl_Titles WHERE FilmID = '$id' AND Country_col = '$cnt' AND TitleType_col = '$type' "); while($row = mysqli_fetch_object($restit)) $ftit = $row->Title_col; mysqli_free_result($restit);
But it’s not working! $ftit is showing empty when it shouldn’t be.
What puzzles me most is that I have very similar code in another file that works fine. The only difference I can see between the two is in the query itself, which makes little sense since they both use standard SQL syntax.
So puzzle me that.
Anyone can help me understand why the above doesn’t work?