Question: I have a bash script .sh file in which I am accessing a MySQL database that contains a table called "Foo". I am having trouble with the MySQL syntax to perform an update query to set the value in column "Bar" only if "Bar" exists in table "Foo" and else, update values in other columns in "Foo" without column "Bar". The if/else statement is fed through a wrapper that accesses MySQL command line interface and the update query itself I already have.

I would like to avoid creating a procedure or a function if possible.

Right now, the if/else looks like this:

```
   IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Foo' AND 
   column_name='Bar') THEN
       //UPDATE Foo SET Bar query
   ELSE
      //UPDATE Foo without column Bar
   END IF;

```

I have been searching for hours but still am running into a Query Error of:

```
Query Error: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Foo' AN' at line 1

```

Answer: 
My issue came from the fact that for some reason, the lib does not prompt download when you put a local image inside of the pdf generated.

I had img/image.png inside of my pdf-content that is why it was not working.
The only problem is that you didnt import the js file into your html.
I added it and worked perfectly

```
<script src="script.js"></script>

```