jake_ms Posted April 20, 2007 Share Posted April 20, 2007 This should be simple enough but for some reason it's not working. The $name is a number which is being posted across when the user clicks submit. I want the PHP to then access the Database with this number and use it to delete the staff ID (which is a PK). With this code I get the error: Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in /homedir/ilex-s01/jmsuther/public_html/DeleteStaff.php on line 16 Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in /homedir/ilex-s01/jmsuther/public_html/DeleteStaff.php on line 17 ; The code is: $name = $_POST["staffnodelete"]; IF ($staffnodelete=="" ) {print "You selected $name - for deletion ";} putenv("TNS_ADMIN=/u1/oracle/Products/shu10g/network/admin"); $con = OCILogon("username","password","10g"); $query = "DELETE FROM staff WHERE staffno = $name"; $query = $query_post [$name]; $stmt = ociparse($conn, $query); ociexecute ($stmt); Any help'd be much appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/47875-trying-to-delete-a-row/ Share on other sites More sharing options...
jitesh Posted April 20, 2007 Share Posted April 20, 2007 Just check once these apis for test only oci_connect (PHP 5) oci_connect -- Establishes a connection to the Oracle server Description resource oci_connect ( string username, string password [, string db [, string charset [, int session_mode]]] ) ----------------------------------------------------------------------------------------- oci_parse (PHP 5) oci_parse -- Prepares Oracle statement for execution Description resource oci_parse ( resource connection, string query ) -------------------------------------------------------------------------------- oci_execute (PHP 5) oci_execute -- Executes a statement Description bool oci_execute ( resource stmt [, int mode] ) Link to comment https://forums.phpfreaks.com/topic/47875-trying-to-delete-a-row/#findComment-233913 Share on other sites More sharing options...
Michael Lasky Posted April 20, 2007 Share Posted April 20, 2007 $query = $query_post [$name]; What is $query_post? If you overwrite your sql statement ociParse won't be able to parse it. Link to comment https://forums.phpfreaks.com/topic/47875-trying-to-delete-a-row/#findComment-234082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.