943,640 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 650
  • PHP RSS
Jun 29th, 2008
0

Translate attempt

Expand Post »
I am trying to translate the PHP script into Java. If anything please advise what or how this translates?

PHP:
PHP Syntax (Toggle Plain Text)
  1. if(isset($_GET['getClientId'])){
  2. $res = mysql_query("select * from tableOne where clientID='".$_GET['getClientId']."'") or die(mysql_error());
  3. if($inf = mysql_fetch_array($res)
  4.  
  5. ...

My attempt in Java and it is giving me errors with getClientId part and lost in fetching array part.
PHP Syntax (Toggle Plain Text)
  1. //db connection part here...
  2.  
  3. try {
  4. String res = "";
  5. if(getParameter("getClientId")) {
  6. res = stmt.executeQuery("select * from tableOne where clientID='" + getParameter("getClientId") + "');
  7.  
  8. String $inf [];
  9. if($inf.equals(getParameterValues($res)) {
  10.  
  11. ....
  12.  
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
chicago1985 is offline Offline
36 posts
since Nov 2007
Jun 29th, 2008
0

Re: Translate attempt

are you wanting us to translate it into java for you or just explain what the php is doing so you can make it into java.
Last edited by kkeith29; Jun 29th, 2008 at 5:23 pm.
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Jun 29th, 2008
0

Re: Translate attempt

Click to Expand / Collapse  Quote originally posted by kkeith29 ...
are you wanting us to translate it into java for you or just explain what the php is doing so you can make it into java.
I tried translating it to Java and its not working. I am trying (in Java) to take the results and return it as an array, where each field of the row is in an array key.

Please correct my translation attempt in Java if possible.
Reputation Points: 10
Solved Threads: 0
Light Poster
chicago1985 is offline Offline
36 posts
since Nov 2007
Jun 29th, 2008
0

Re: Translate attempt

sorry i don't know java. hopefully someone else will be able to help.
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Jun 30th, 2008
0

Re: Translate attempt

Umm.. wouldn't it be better if you post your question in Java forum ?
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: There was a problem parsing your XML
Next Thread in PHP Forum Timeline: how to disabled radio button went sent form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC