Home » Open Source » Programming Interfaces » implementing the ondblclick feature in php with an oracle database. (PHP and Oracle)
implementing the ondblclick feature in php with an oracle database. [message #310630] Tue, 01 April 2008 18:28 Go to next message
kingE
Messages: 2
Registered: April 2008
Junior Member
I am trying to implement the onondblclick feature in php. I have managed to set up the statements below:- $sql="SELECT * FROM PropertyForRent9 ORDER BY PropertyID"; $stmt=ociparse($conn,$sql); ociexecute($stmt); echo("<form name=\"myForm\" method=\"post\" action =\"$PHP_SELF\"> <select class=\"butSt2\" size=\"10\" name=\"sel_id\" ondblclick=\"document.myForm.submit()\">"); while (ocifetchinto($stmt,$myrow, OCI_ASSOC)Wink { if ($myrow["PropertyID"] == $PropertyID) { printf("<option selected value=\"%s\" />%s, %s, %s, %s, %s, %s, %s
", $myrow["PropertyID"], $myrow["LeaseID"], $myrow["PropertyOwnerID"], $myrow["street"], $myrow["city"], $myrow["postcode"], $myrow["TypeOfProperty"], $myrow["furniture"]); }else{ printf("<option selected value=\"%s\"/>%s,%s,%s,%s,%s,%s,%s
", $myrow["PropertyID"], $myrow["LeaseID"], $myrow["PropertyOwnerID"], $myrow["street"], $myrow["city"], $myrow["postcode"], $myrow["TypeOfProperty"], $myrow["furniture"]); } } echo("</select></form>"); ocifreestatement($stmt); There are three rows of data in the PropertyForRent9 table and every time i run the php file it brings up something like this. ie:- , , , , , , , , , , , , , , , , , , in otherwords no data is collected from the database. Has any one got a way to implement this. thanks, kingE
Re: implementing the ondblclick feature in php with an oracle database. [message #310632 is a reply to message #310630] Tue, 01 April 2008 18:38 Go to previous messageGo to next message
BlackSwan
Messages: 21945
Registered: January 2009
Senior Member
MY!
what an UGLY mess.

>There are three rows of data in the PropertyForRent9 table


When was the last time you successfully (ab)used PHP to get data from Oracle?


If what you claim is true, then the problem is with your PHP code & not Oracle.
icon5.gif  Re: implementing the ondblclick feature in php with an oracle database. [message #311217 is a reply to message #310632] Thu, 03 April 2008 13:50 Go to previous messageGo to next message
kingE
Messages: 2
Registered: April 2008
Junior Member
Hi thanks for the reply,
i am quite new to this stuff and that is why am seeking help.
i only started using oracle and php this year.
so i suppose i can not successfuly use php to get data from oracle.
If i use the echo statements to just print out the list of that data in that table, the results are shown successfully. But if i use the double click feature as that one described below in the echo statement nothing comes up. just blanks separated by comas.
I was intending to display an array of data from the table and on double clicking the result it is posted to a different same form in a secton benlow form for editing or deleting.
what could be the best way to implement this.
thanks.

I have attached the code of the file below.


$sql="SELECT * FROM PropertyForRent9 ORDER BY PropertyID"; $stmt=ociparse($conn,$sql);
ociexecute($stmt);
echo("<form name=\"myForm\" method=\"post\" action=\"$PHP_SELF\"> <select class=\"butSt2\" size=\"10\" name=\"sel_id\" ondblclick=\"document.myForm.submit()\">");

while (ocifetchinto($stmt,$myrow, OCI_ASSOC)
{ if ($myrow["PropertyID"] == $PropertyID)
{ printf("<option selected value=\"%s\" />%s, %s, %s, %s, %s, %s, %s", $myrow["PropertyID"], $myrow["LeaseID"], $myrow["PropertyOwnerID"], $myrow["street"], $myrow["city"], $myrow["postcode"], $myrow["TypeOfProperty"], $myrow["furniture"]); }

else{ printf("<option selected value=\"%s\"/>%s,%s,%s,%s,%s,%s,%s
", $myrow["PropertyID"], $myrow["LeaseID"], $myrow["PropertyOwnerID"], $myrow["street"], $myrow["city"], $myrow["postcode"], $myrow["TypeOfProperty"], $myrow["furniture"]);
}
}
echo("</select></form>");
  • Attachment: new22.txt
    (Size: 5.17KB, Downloaded 219 times)
Re: implementing the ondblclick feature in php with an oracle database. [message #311443 is a reply to message #310630] Fri, 04 April 2008 09:05 Go to previous message
BlackSwan
Messages: 21945
Registered: January 2009
Senior Member
>If i use the echo statements to just print out the list of that data in that table, the results are shown successfully.
Once again, you prove to yourself & everyone else the SQL works;
so the problem is what happens after that in your PHP code.
Please go post this is some dedicated PHP forum.
Previous Topic: Reading LOBS using Perl - help!!
Next Topic: get list of running instances
Goto Forum:
  


Current Time: Sat Apr 19 07:10:40 CDT 2014

Total time taken to generate the page: 0.09104 seconds