hello.
I have a table populated by name. The names are links when clicked will pop up a form for editing. each input (for editing) is populated by the equal value from database but im having trouble with one particular text box. this text box is for date of birth and it only shows part of the data. for example in the database dob is 2 January 1993 in the popped up form it only shows 2. the rest of the input are fine and display full data its just this one.
php code:
<?php
$contact = $_GET['contact'];
require "connection.php";
$getcontact = $dbh->prepare("SELECT * FROM contact1 WHERE contact_id = ? ");
$getcontact->bindParam(1, $contact, PDO::PARAM_INT);
$getcontact->execute();
if($getcontact->rowCount() > 0){
$getcontact->setFetchMode(PDO::FETCH_ASSOC);
while($row = $getcontact->fetch()){
echo "<form action=\"updateContact.php\" method=\"POST\">
<fieldset class=\"updatecontact\">
<label>Update Contact</label><br><br>
<input type=\"hidden\" name=\"contactid\" value=".$row['contact_id'].">
<label>Salutation :</label>
<select name=\"salutations\" >
<option value=". $row['salutation'] ." selected>". $row['salutation'] ."</option>
<option value=\"Datin\">Datin</option>
<option value=\"Datin Paduka\">Datin Paduka</option>
<option value=\"Dato Paduka\">Dato Paduka</option>
</select><br>
<label>First Name :</label><input type=\"text\" name=\"fname\" class=\"style\" value=". $row['fname'] .">
<label>Last Name :</label><input type=\"text\" name=\"lname\" class=\"style\" value=". $row['lname'] .">
//THIS IS THE DOB INPUT that has the problem
<label>Date of Birth : </label>
<input type=\"text\" name=\"dob\" value=".$row['dob']."><br><br>
<label>House Address :</label><textarea name=\"line1\" rows=\"2\" cols=\"20\">". $row['house'] ."</textarea>
<label>Mobile No :</label><input type=\"text\" name=\"mobile\" class=\"style\" value=". $row['mobile'] .">
<label>Office No :</label><input type=\"text\" name=\"office\" class=\"style\" value=". $row['office'] .">
<label>Email Address : </label><input type=\"email\" name=\"email\" class=\"style\" value=". $row['email'] .">
</fieldset>
<br>
<div><input type=\"submit\" name=\"updateC\" value=\"Update\" />
<input type=\"button\" name=\"cancel\" value=\"Cancel\" /></div>
</form>";
}
}
?>
i have tried declaring the variable one by one and referencing them like:
$dob = $row['dob];
value= ".$dob."
but still get the same partially displayed data. also the php is the only coding in the page. no other coding, like js.
TIA!