473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using a text box disply date and time.

23
We are trying to get the following script to display the full date and time. The field we are calling does have both date and time in. Unfortunatly its only returning the date.

So I tried putting the sql "to_date('Adate','dd/mm/yyyy hh24:mi')" to disply the full field. No Luck

Any help is much appresiated. Thanks.[php]<HTML>
<HEAD><TITLE> Property Results </TITLE>
</HEAD>
<BODY>
<?php
$sql="Select * from Appointment where Appointment_id = ".$_GET["Appointment_id"];
putenv("TNS_ADMIN=/u1/oracle/Products/shu10g/network/admin");
$conn = OCILogon("Username","Password","shu10g");
$stmt = ociparse($conn,$sql);
ociexecute($stmt);
ocifetchinto($stmt,$row);
ocifreestatement($stmt);
ocilogoff($conn);
?>
<form name="form1"method="post" action="appointmenthandler.php">
<input name="Appointment_id" type=hiddenid="Appointment_id" value='<?php print $row[0];?>'>

<table width="75%" border="1">
<tr>
<td><strong>Appointment ID</strong></td>
<td><?php print $row[0];?></td>
</tr>
<tr>
<td><strong><strong>Staff ID
</stong>
</strong></td>
<td><input name="Staff_id" type="text" id="Staff_id" value='<?php print $row[1];?>'></td>
</tr>
<tr>
<td><strong><strong>Tenant ID
</string>
</strong></td>
<td><input name="Tenant_id" type="text" id="Tenant_id" value='<?php print $row[2];?>'></td>
</tr>
<tr>
<td><strong>Property ID</strong></td>
<td><input name="Property_id" type="text" id="Property_id" value='<?php print $row[3];?>'></td>
</tr>
<tr>
<td><strong>Description</strong></td>
<td><input name="Description" type="text" id="Description" value='<?php print $row[4];?>'></td>
</tr>
<tr>
<td><strong>Appointment Date</strong></td>
<td><input name="Adate" type="text" id="Adate" value=
'<?php
$sql="Select to_date('Adate','dd/mm/yyyy hh24:mi') from Appointment where Appointment_id = ".$_GET["Appointment_id"];
putenv("TNS_ADMIN=/u1/oracle/Products/shu10g/network/admin");
$conn = OCILogon("Username","Password","shu10g");
$stmt = ociparse($conn,$sql);
ociexecute($stmt);
ocifetchinto($stmt,$row);
print $row[5];
ocifreestatement($stmt);
ocilogoff($conn);
?>'
</td>
</tr>
<tr>
<td><strong>Duration (Min)</strong></td>
<td><input name="Duration_Min" type="text" id="Duration_Min" value='<?php print $row[6];?>'></td>

</tr>
</table>
<p>
<input type="submit" name"Submit" value="Submit">
</p>
</form>
</BODY>
</HTML>[/php]
Apr 11 '08 #1
2 3712
ronverdonk
4,258 Expert 4TB
warning:

Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
Apr 11 '08 #2
Atli
5,058 Expert 4TB
Hi.

I'm not really good with Oracle, so I can't tell if there is a problem with the SQL.

But...You could always use the PHP date functions to format the date.

Try getting the actual timestamp from your database and use the date function to create your output.

If the database doesn't return a timestamp, try the strtotime function to convert it.
Apr 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Robert Scarborough | last post by:
I have a Table in a Typed Dataset which contains a Date field called EventDate. I've ensured that the field is defined as Date as opposed to DateTime in the Typed Dataset. When I generate an...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
1
by: vikraman | last post by:
Please How can I Disply Text when the curser is at a specific coordinate in the Body/Image,and what is the script?
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.