954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Translate attempt

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

PHP:

if(isset($_GET['getClientId'])){  
  $res = mysql_query("select * from tableOne where clientID='".$_GET['getClientId']."'") or die(mysql_error());
  if($inf = mysql_fetch_array($res)

...


My attempt in Java and it is giving me errors with getClientId part and lost in fetching array part.

//db connection part here...

try {
String res = "";
if(getParameter("getClientId")) {
   res = stmt.executeQuery("select * from tableOne where clientID='" + getParameter("getClientId") + "');
  
String $inf []; 
if($inf.equals(getParameterValues($res)) {

....
chicago1985
Light Poster
36 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

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.

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 
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.

chicago1985
Light Poster
36 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

sorry i don't know java. hopefully someone else will be able to help.

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

Umm.. wouldn't it be better if you post your question in Java forum ?

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You