The following query worked in previous versions of php using mysql_query and mysql but returns nothing under php7, mysqli_query and mariadb.

SELECT tlink_item_gallery.gallery_id, tlink_item_gallery.img_priority, tbl_items.item_id, tbl_items.item_image, tbl_items.title, tbl_items.media, tbl_items.support, tbl_items.format_options FROM tlink_item_gallery INNER JOIN tbl_items ON tlink_item_gallery.item_id = tbl_items.item_id WHERE tlink_item_gallery.gallery_id = 5 AND tbl_items.state = 'active' ORDER BY tlink_item_gallery.img_priority ASC LIMIT 3

The script successfully runs simpler queries.

I'm wondering if there is any change in the JOIN syntax that might be causing this.

I've spent hours looking for an issue but can't find one.

--Kenoli

    If it's the query's fault then it has nothing to do with PHP; but no, it would be stupid to change JOIN in a way that would break standard usage.
    Have you done any debugging (like checking for error messages and the like)?

      Thanks for your reply, I appreciate your taking the time.

      I finally found out that it was another piece of script that was conflicting with php7 that was crashing the query. The script bounced back and forth between a few classes and I had to following the ant trail into all the nooks and crannies.

      It has been a battle conforming to php7. Having to test every function attribute, variable and global variable has been a surprising challenge and had highlighted what, I guess, has been sloppy coding practice, at least regarding this issue. I was thinking of simply lowering the error level but decided to try to upgrade my coding practices instead.

      I got used to sending different GET info to a script for different purposes and simply managing what showed up or didn't. Can't do that any more. Same with function attributes. Not sure exactly why getting more draconian is an advantage, though I can imagine it might make it harder for someone to slip into a script somehow.

      My scripts have been broken into from time to time, and I've paid a lot of attention to database calls in this regard, primarily using PDO and being careful about queries.

      It hasn't caused much damage, though I did once lose some images on a site where I had stored images in a database.

      I'm not dealing with any data that is of consequence to anyone. I think the people that have gotten into my site have been teenagers with too much time on their hands. At least it gives them something to do.

      I don't do anything commercial and its usually easy to fix the pranks they play.

      --Kenoli

        Kenoli wrote:

        Not sure exactly why getting more draconian is an advantage

        You kind of answered your own question.

        had highlighted what, I guess, has been sloppy coding practice,

          Write a Reply...