Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-08-2008, 09:25 PM   PM User | #1
kamsmartx
New to the CF scene

 
Join Date: May 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
kamsmartx is an unknown quantity at this point
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;  

kamsmartx is offline   Reply With Quote
Old 05-08-2008, 10:57 PM   PM User | #2
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
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?
tomws is offline   Reply With Quote
Old 05-08-2008, 11:05 PM   PM User | #3
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
must be "patient" as in: "The doctor's patient is here."
mlseim is offline   Reply With Quote
Old 05-08-2008, 11:35 PM   PM User | #4
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
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.
tomws is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:32 PM.


Advertisement
Log in to turn off these ads.