0

Hello everybody!

My roommate had a problem and asked me for some help. I do not write in Java so I would need some help translating my code from PHP into Java.

Here is the code:

<?php

mysql_connect ( "someserver", "someusername", "somepassword" ) ;
mysql_select_db("somedatabase");

$q = mysql_query ( "SELECT * FROM sektor_c" ) ;

echo "<table style='border: 1px solid'>";
while ( $result = mysql_fetch_object ( $q ) )
{
    echo "<tr>" ;
    $q2 = mysql_query ( "SELECT * FROM sektor_s ss LEFT JOIN merchandise_confired mc ON (ss.id_ss=mc.id_ss AND ids_c=" . $result->ids_c . ")"  ) ;
    while ( $result2 = mysql_fetch_object($q2))
    {
        $confirmed = $confirmed_end = "" ;
        if ( $result2->idm_c !== NULL )
        {
            $confirmed      = "<b>";
            $confirmed_end  = "</b>";
        }
        echo "<td>$confirmed {$result->initial}{$result2->number} $confirmed_end</td>";
    }

    echo "</tr>";
}

echo "</table>";

Thank you for your help!

Edited by SuchANewb: small edit

2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by NormR1
0

Please post the code here and its output and add comments to the output explaining what it wrong with it and what it should look like.

Edited by NormR1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.