Skip to content
Advertisement

Tag: output

PHP MySQL GET RESULT from INSERT INTO IF NOT EXIST

I know how to do INSERT INTO if the record doesn’t exist. But if it does exist, mysql doesn’t treat it as an error. It just treats it as 0 rows inserted. I want to know if that was the case and return that message to the user that the data they submitted already exists. I know I can do

Printing debug output to console in Codeception

Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for debugging the tests themselves (e.g. like you would var_dump() a variable in any regular PHP website) I have already tried var_dump(), echo and print but to no avail. Using

Execute an external program in php and return output file download link

I’m trying to run file_creator.exe via PHP which accepts some arguments and produces an output file. so how can I get the name of output file in order to produce the download link? Answer You will want to use shell_exec() function in PHP (http://php.net/manual/en/function.shell-exec.php) to run your exe file. Pass in the parameters in the command line such as: Whatever

Advertisement