简体   繁体   中英

Oracle Error in oci_parse()

I have the following error

Warning: oci_parse() expects parameter 1 to be resource, boolean given in C:\\wamp\\www\\JQueryMobileTest\\submit.php on line 28

this is my code :

        <?php 
    $sql="UPDATE table1 SET updated_date =SYSDATE ,trx_status ='Submitted'  where TO_CHAR(trx_date, 'mm/dd/yyyy') LIKE '%$search%' AND trx_status = 'Saved'";

        $res= oci_parse($link, $sql);
        oci_execute($res);
    ?> 

i don't konw whats the problem ,, please any one can help me ?

If $link is boolean, then most likely its value is false . This happens when connection to database failed. oci_connect returns false if an error happened. See documentation for more details.

You can find the error by calling oci_error() . Example from the documentation:

$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM