oci_bind_by_name()
expects a variable reference as its third argument, so your static string value is not a valid argument. You must bind a variable as a third argument. That's why your second example does work.
You'll need to place your strings into variables and bind those just as you did in the second case.
bool oci_bind_by_name ( resource $statement , string $bv_name , mixed &$variable [, int $maxlength = -1 [, int $type = SQLT_CHR ]] )
I would recommend turning up error reporting and enabling display_errors
. You should probably be seeing warnings about the argument expecting a reference. Always do this in development:
; In php.ini
error_reporting = E_ALL
display_errors = On
// Or at runtime
error_reporting(E_ALL);
ini_set('display_errors', 1);