I am trying to enclose a DB_ID function within an IF statement and I'm getting a red squiggly line under the IF please see below for my line of coding, this is in MySQL: enter image description here
The Syntax error reads as follows: Syntax error: 'IF' (if) is not valid input at this position
What I'm trying to do is have the script check to see if the database already exists in the system, if it does then it will drop the database. Then the following line outside of the IF statement will create a new database.
I read somewhere that it's because if functions have to be within another function but I'm not sure how to do that and get the same results that I am trying to accomplish.
Any suggestions to why I am getting this error?
Aucun commentaire:
Enregistrer un commentaire