Skip to content
Advertisement

PHP : Collect All Errors First Before Run Query

Is there any way to check if there will be an error on file uploading? Like putting a variable to know if there’s an error on every else statement so that before it will prevent running the query. Because what’s happening is even there’s an error on moving/copying/deleting a file, it still runs the query.

JavaScript

Advertisement

Answer

Use exit after echo if you don’t want the query to run e.g $dir = ‘./uploads/images/’;

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement