473,804 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a text box disply date and time.

23 New Member
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_ADM IN=/u1/oracle/Products/shu10g/network/admin");
$conn = OCILogon("Usern ame","Password" ,"shu10g");
$stmt = ociparse($conn, $sql);
ociexecute($stm t);
ocifetchinto($s tmt,$row);
ocifreestatemen t($stmt);
ocilogoff($conn );
?>
<form name="form1"met hod="post" action="appoint menthandler.php ">
<input name="Appointme nt_id" type=hiddenid=" Appointment_id" value='<?php print $row[0];?>'>

<table width="75%" border="1">
<tr>
<td><strong>App ointment ID</strong></td>
<td><?php print $row[0];?></td>
</tr>
<tr>
<td><strong><st rong>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><st rong>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>Pro perty ID</strong></td>
<td><input name="Property_ id" type="text" id="Property_id " value='<?php print $row[3];?>'></td>
</tr>
<tr>
<td><strong>Des cription</strong></td>
<td><input name="Descripti on" type="text" id="Description " value='<?php print $row[4];?>'></td>
</tr>
<tr>
<td><strong>App ointment 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_ADM IN=/u1/oracle/Products/shu10g/network/admin");
$conn = OCILogon("Usern ame","Password" ,"shu10g");
$stmt = ociparse($conn, $sql);
ociexecute($stm t);
ocifetchinto($s tmt,$row);
print $row[5];
ocifreestatemen t($stmt);
ocilogoff($conn );
?>'
</td>
</tr>
<tr>
<td><strong>Dur ation (Min)</strong></td>
<td><input name="Duration_ Min" type="text" id="Duration_Mi n" 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 3739
ronverdonk
4,258 Recognized Expert Specialist
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 Recognized Expert Expert
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
350
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 xml file from an instance of this typed dataset using the ds.WriteXml method, all the dates come out formatted as follows: <EventDate>2004-01-26T00:00:00.0000000-05:00</EventDate>
9
3976
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 will not set the value of the control and will leave the checked status of the checkbox to false when a user selects a new date. this works fine when using the control on a win2k machine but if we use it on a win XP box and call
5
2042
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 one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where the problem is raised. My database is an Access database. The table i am updating contains a Date...
0
5570
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 is used to view the state of the running jobs and schedule new jobs. The control also runs in the context of Internet Explorer (we do this so the administrators of the jobs can always receive the latest control). The property grid is used to...
6
17208
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, process and output to the screen in my application when a message arrived. But the problem is how do I read the SMS message immediately when it arrived without my handphone BeEPINg for new message ? I read up the AT commands, but when getting down...
1
1446
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
3203
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 follows: The code below is for the first page:session_start is in line 3 <link href="css/jobSheet.css" rel="stylesheet" type="text/css" /> session_start();
1
3466
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 have to made in my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10569
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.