简体   繁体   中英

search button and display the data in php

i would like to ask regarding the php code and oracle sql. I am developing a website for a system as my project task. for the searching page, user can fill in one of the searching field and the system will display all the required details based on what user search for. can anyone teach me on how to do the php code to link with the oracle SQL database. as what i have done so far is:

$sql = "SELECT * FROM sdlrules_tbl_wip_queue
        where lotid = trim(upper((:lotid)),
              eqpId = trim(upper(:eqpId)),
              stepName =  trim(:stepName),
              sequence = trim(:sequence)";

if($_REQUEST["lotId"]!=""){
        $sql .= "SELECT 
                LOTID,PLAN,STEPSEQ,STEPNAME,LOTTYPE,PRIORITY,DEVICE,EQPID,REMARK
                FROM
                sdlrules_tbl_wip_queue
                WHERE lotid = trim(upper(:lotid))";
}

if($_REQUEST["eqpId"]!=""){
        $sql = "SELECT * FROM sdlrules_tbl_wip_queue
                WHERE eqpId = ':eqpId'";
}

if($_REQUEST["stepName"]!=""){
        $sql = "SELECT * FROM sdlrules_tbl_wip_queue
                WHERE stepName = ':stepName'";
}

if($_REQUEST["sequence"]!==""){
        $sql = "SELECT * FROM sdlrules_tbl_wip_queue
                WHERE sequence = ':sequence'";
}

can anyone teach me on how to do the php code to link with the oracle SQL database.

This is a broad question.

Oracle has two manuals you might want to check out

There is some older install content in these books you can skip, but there is much material that is useful.

You simply need to read following resources to connect to Oracle database and perform required operations. Just read functions descriptions. Its pretty straight forward.

http://php.net/manual/en/intro.oci8.php

http://php.net/manual/en/ref.oci8.php

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