Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    61

    Unanswered: convert this for me please.

    I'm use to dealing with PHP and MYSQL.

    Can someone convert these MYSQL / PHP codes to work with oracle?


    1)
    "

    $db = mysql_connect("localhost", "logbookuser", "mysqlpassword");

    mysql_select_db("logbook",$db);

    username = $_SESSION['PER_ID'];
    $sql = "UPDATE MODEL SET MODEL='$MODEL', MULTI='$multi', COMPLEX='$complex', HIGH_PERF='$high_perf', TURBOPROP='$turboprop', TURBOJET='$turbojet', TAILWHEEL='$tailwheel', GLIDER='$glider', ROTORCRAFT='$rotorcraft', SEA='$sea', SIM='$sim' WHERE MODEL_ID=$modelid ";


    $result = mysql_query($sql);

    "
    This Was a simple update query. I'm assuming that to make this work with oracle won't be too different.

    Here is another one:

    2)

    "

    $db = mysql_connect("localhost", "logbookuser", "mysqlpassword");

    mysql_select_db("logbook",$db);

    $result = mysql_query("SELECT * FROM MODEL RIGHT JOIN MAIN ON MODEL.MODEL_ID = MAIN.MODEL_ID WHERE MAIN.PER_ID='$username' ORDER BY $sort $order LIMIT $startwith, 20",$db);
    while ($myrow = mysql_fetch_array($result))
    {
    extract ($myrow);
    .... blah blah blah.....
    }

    "

    Okay. Thanks in advance. I just need to know the basic differences and this would be a good example.

    Thanks
    Noam

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select *
    from tableA ta
    where id IN
    (select id
    from
    (select id, rownum As RN
    from tableA
    ) V
    where V.rownum Between x and y)
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •