Forum Moderators: coopster

Message Too Old, No Replies

Another PHP7 Question

         

SeanF

6:09 pm on Dec 1, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



(Never Mind... found the problem: I had mitted the database connection form the mysqli_real_escape_string() function.)

Hi:

I am switching a rather large PHP/MySQL application from PHP5x to PHP7, which involves a couple thousand database calls. It's going pretty well except there is one "autocomplete" fiction I can't get to run. I m not sure if I'm missing a mysqli function or of there is something else going wrong.

The basic idea is: as a user starts typing a portion of a company name, the system looks up a match in a MySQL table and return a list of possible company names.

The code looks like this (Sorry for the long message):
***CODE DELETED ***

[edited by: SeanF at 6:43 pm (utc) on Dec 1, 2019]

robzilla

6:43 pm on Dec 1, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The link to the database needs to be passed to MySQLi functions like mysqli_query() and mysqli_real_escape_string(). Switching from mysql functions to mysqli isn't as simple as changing the function names, unfortunately.

Your error log will probably tell you this, too.