textbox output

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ehcy
    New Member
    • Oct 2007
    • 22

    #1

    textbox output

    hello! i have a problem here will you please help me?.. this is my script

    [PHP]

    <?php

    //$text = "Like '%american journal of med%'";

    $text = $_POST["box"];
    $sep = " ";
    $out = strtok($text, $sep);

    $output = " TI Like '%$out%' ";

    $sql ="SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE ".$output;


    echo $sql;


    while ($out !== false)
    {


    $out = strtok(" ");

    if ($out ==false) {
    echo "AND";

    }
    }


    function db_connect_ctlg ()
    {
    $conn = odbc_connect("s ys_foresta_ctlg ", "sa", "");
    if(!$conn)
    {
    // x借yP失z・写rf r(qz
    return NULL;
    }
    else
    {
    return $conn;

    }
    }


    function ExecInforestaQu ery($query){

    $Set=db_connect _ctlg();

    if (!$Set)

    {
    echo "Connect Failer!!<BR>";
    return NULL;
    }
    else
    {
    $query_result = odbc_exec($Set, $query);

    if (!$Set)
    {
    echo "Query Failer!!<BR>";
    return NULL;
    }
    else
    {
    return $query_result;
    }
    }
    }

    $XResult=ExecIn forestaQuery($s ql);

    $x=0;
    while($rec = odbc_fetch_arra y($XResult)){
    $title=$rec['TI'];

    $y=0;
    $Count=0;
    while($x>$y){
    if ($a[$y][0]==$title){
    $a[$y][1]=$a[$y][1]+1;
    $Count=1;
    }
    $y=$y+1;
    }

    if ($Count==0){
    $a[$x][0]=$title;
    $a[$x][1]=1;
    $x=$x+1;
    }
    }

    $X=0;
    while($X<$x){
    //echo $a[$X][0]." </BR> ";
    $X=$X+1;
    }

    odbc_free_resul t($XResult);

    ?>

    [/PHP]

    and i want this output..

    - output -

    SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE TI Like '%new%' AND Like '%eng%' AND Like '%jour%'

    if i'm going to put the new eng jour at textbox.. the textbox output appear after the SELECT output..

    please help me.. tnx!
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    #2
    Hi,

    I don't get you question, could you give me some more information?

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      What output do you get?

      Comment

      • ifedi
        New Member
        • Jan 2008
        • 60

        #4
        Originally posted by ehcy
        and i want this output..

        - output -

        SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE TI Like '%new%' AND Like '%eng%' AND Like '%jour%'

        if i'm going to put the new eng jour at textbox.. the textbox output appear after the SELECT output..

        please help me.. tnx!

        I'm not sure I get all you were trying to say! But looking at the output you said you want, I notice an SQL syntax error:

        Code:
        WHERE TI Like '%new%' AND Like '%eng%' AND Like '%jour%'
        it should read:
        Code:
        WHERE TI Like '%new%' AND TI Like '%eng%' AND TI Like '%jour%'
        I must confess I couldn't go thru the entire php code, but the SQL issue would surely prove important anyhow, when you get to that stage.
        Best of luck.

        Ifedi

        Comment

        • ifedi
          New Member
          • Jan 2008
          • 60

          #5
          Hey,

          And by the way, ehcy. Are you into medicine? I just noticed the title of the journal you were illustrating with. I am a medical doctor.

          Ifedi.

          Comment

          • ehcy
            New Member
            • Oct 2007
            • 22

            #6
            Originally posted by ifedi
            Hey,

            And by the way, ehcy. Are you into medicine? I just noticed the title of the journal you were illustrating with. I am a medical doctor.

            Ifedi.
            sorry for late reply.. i'm working at medeical research company here in phils. and i'm under training for web design (programming).. nice to meet you sir

            Comment

            • ifedi
              New Member
              • Jan 2008
              • 60

              #7
              Originally posted by ehcy
              sorry for late reply.. i'm working at medeical research company here in phils. and i'm under training for web design (programming).. nice to meet you sir
              I'm sorry what and where's phils? Phillipines?
              And have you gotten round to a solution for your problem (above)?

              Comment

              • ehcy
                New Member
                • Oct 2007
                • 22

                #8
                Originally posted by ifedi
                I'm sorry what and where's phils? Phillipines?
                And have you gotten round to a solution for your problem (above)?
                hello.. i'm done with my problem before but i have a new one.. hehehe.. i want to add the details of the book.. for examples.. i will input the year, volume, issue #, and the author to each textbox and if i will click the DONE command button.. it will save to my database..

                Comment

                • ehcy
                  New Member
                  • Oct 2007
                  • 22

                  #9
                  Originally posted by MarkoKlacar
                  Hi,

                  I don't get you question, could you give me some more information?

                  hello.. may i add you to my contact list.. 'cause i really need an programmer expert to help me do my problem regarding programming.. thanks

                  Comment

                  Working...