Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: big problem why

  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    big problem why

    hi all
    i have this code
    PHP Code:
    <select name="Number"  onChange="change_title(this.value);">     
        <?      
    $query
    ="SELECT * FROM pationt";     
    $result=mysql_query($query) or die("error: " mysql_error());     
    while(
    $row=mysql_fetch_array($result))     
    {     
    ?>       
    <option value="<?php echo $row['name'] ; ?>"><?php echo $row['Number'] ; ?></option>        
    <?     
        
    }       
    ?>     
    </select>
    this code is get the Number of pationt from table on data base called pationt
    ..ok

    =====
    then on this code

    PHP Code:

    <input name="Name" type="text" id="title"/> 
    print the name of pationt that selected from above code


    but the problem is when i press ok button to save this operation on other table we save only Number of pation on two filed "pationtNO , PationtName"
    why

    ya this is the javascript

    PHP Code:
    function change_title(ref)  
    {  
         
    document.getElementById('title').value  ref;  


  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    This is a javascript problem, not PHP. I can't decipher your English well enough to understand what you're saying about saving to a table somewhere.

    By the way, what is a pationt?

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,518
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    must be "patient" as in: "The doctor's patient is here."

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Well, I thought that might be it, but it's even wrong as the field name in the table. I don't know why, but I suppose I place higher standards on software developers' spelling than, say, slackers hanging letters on the marquee at McDonald's.

    Hoping the word is rather something from the OP's native language that doesn't translate well. Then everyone's happy.


  •  

    Posting Permissions

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