Hi
I would like to know BEFORE I SAVE A NEW ENTRY THAT HE USER IS FILLING how I can it shows the default value thatis set in SQL db.
I have set in my SQL as follows:
FIELD: date1
TYPE: DATE
NULL: NULL
Default: 0000-00-00
The script is:
[code=php]
<?
if ($id) {
$sql2=”select * from “table name” where id=’$id’ limit 1 “;
$result=mysql_db_query(“database “,$sql2);
$regist=mysql_fetch_array($result);
$id=$regist [“id”];
(other)
(other)
$date=$regist [“date1”];
}
?>
<table>
<tr>
<td width=”36″ align=”center”><input name=”data1″ type=”text” id=”data1″ value='<? echo”$data1″ ?>’ size=”5″ /></td>
</tr>
</table>
The purpose is to appear in the field already 0000-00-00 to show the user the way he must enter the date, instead of having a hint (000-00-00) on the side or on the bottom of the value field.
I hope I have made myself understood.
Thanks a lot