mysql functions

hi everyone

I’m looking for a mysql function that makes the PHP code unusable if you ever wanted to switch to another database.

thanks in advance
Lary

kindly reframe your question? Why would you want to use mysql function for php? No such mysql function exists.

Hi Lary,

I don’t think there’s MySQL function to accomplish that. But, here’s an alternative:

  1. During the selection of database, assign it to a session variable (e.g. $database_a).
  2. If you switch to another database, assign it to another variable and compare it to your current $_SESSION variable.
  3. Use IF/ELSE to accomplish the task.

Cheers… :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service