01745: Invalid hostname / binding warning when running metal-cad code. I'm not sure why this is happening, please help! I feel that it must be something wrong with my attachment, but I donβt see what's wrong with that. My $ Start and $ End variables look like DD-MM-YY. I have listed the PHP code below. Thanks!
PHP:
<?php $year_Echo = '2013'; $yearTruncation = substr($year_Echo, 2); $yearTruncationMinusOne = $yearTruncation-1; $Start = ('1-OCT-'.$yearTruncationMinusOne); $End = ('30-SEP-'.$yearTruncation); echo "Start = ".$Start." End = ".$End." Year Truncation Minus One = ".$yearTruncationMinusOne."<br>"; $db = oci_connect('query','pw','server:1521/view'); if (!$db){ $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $query = "SELECT * FROM db.cooldb WHERE (STATUS = 'ACTIVE' OR STATUS = 'CLOSED') AND NUMBER <> ' ' AND AMENDMENT_DATE_CREATED BETWEEN :start AND :end ORDER BY AMENDMENT_DATE_CREATED DESC"; $runQuery = oci_parse($db, $query); oci_bind_by_name($runQuery, ":start", $Start); oci_bind_by_name($runQuery, ":end", $End); oci_execute($runQuery); while($row = oci_fetch_array($runQuery, OCI_ASSOC+OCI_RETURN_NULLS)) { echo $row['AMENDMENT_DATE_CREATED']." ".$row['TITLE']."<br>"; } ?>
Error:
Warning: oci_execute() [function.oci-execute]: ORA-01745: invalid host/bind variable name
source share