View Full Version : big problem why

05-08-2008, 10:25 PM
hi all
i have this code

<select name="Number" onChange="change_title(this.value);">
$query="SELECT * FROM pationt";
$result=mysql_query($query) or die("error: " . mysql_error());
<option value="<?php echo $row['name'] ; ?>"><?php echo $row['Number'] ; ?></option>

this code is get the Number of pationt from table on data base called pationt

then on this 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"

ya this is the javascript

function change_title(ref)
document.getElementById('title').value = ref;

05-08-2008, 11:57 PM
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?

05-09-2008, 12:05 AM
must be "patient" as in: "The doctor's patient is here."

05-09-2008, 12:35 AM
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.