473,625 Members | 3,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem in fetching date from database

25 New Member
There is a date column in database table in the format as "2010-05-12 15:35:08". I am trying to fetch this field using:
Expand|Select|Wrap|Line Numbers
  1.  while($res =  mysql_fetch_array($sql))
  2.   {
  3.    $data = $res['LoginDate']; 
  4.   }
  5.  
It does not work.
May 20 '10 #1
2 1502
chathura86
227 New Member
What was the output you got? Are you sure that you have records for the query? Try the below and post the result:
Expand|Select|Wrap|Line Numbers
  1.  while($res =  mysql_fetch_array($sql))
  2.   {
  3.    var_dump($res); 
  4.   }
May 20 '10 #2
Atli
5,058 Recognized Expert Expert
@bandy
Hey.

You will have to be more specific. What you posted is far from being enough for us to actually reply with anything useful. We need details, like:

What did you expect this to do? What did it actually do?
Did you get any errors? Warnings? (Are they even turned on?)
May 21 '10 #3

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

Similar topics

0
2052
by: Andres Baravalle | last post by:
Hi, I have a problem using a URL fetching algorithm (HTTP 1.0). To download an image, I used to use this algorithm: <?php Header("Content-type: image/gif"); $referer = "http://www.creators.com/comics_show.cfm?comicname=mrh";
6
2162
by: Pete | last post by:
Hi Guys I have a form which must calc the difference between 2 date fields and return the result in a third field. I have the following code but it does not seem to work. Can anyone tell this total newbie where he is going wrong or suggest a more elegant way of doing this. thanks Pete <head><script>
3
3611
by: Dustin Wilson | last post by:
I have a problem with the following line of code. rstOutput! = FormatDateTime("January 1, 2004", vbLongDate) When I run this on my computer at home it runs without problem but when I run it at work I get a Run-time error '3421' Data type conversion error. I'm really stumped as to why this is. Both computers are Windows 2000 SP4 with Access 2000. The field is a Date/Time field with a format of Long Date set. Does anyone have an idea...
2
1770
by: Andy | last post by:
Hello, I have a question regarding how to format a date in VB so that I can call it from a query and get results. I'm calling functions in the query because that was the only way I found I could set up a query with multiple parameters to return data the way I wanted. (I'm reading up on a filter recordset command that will probably do this much better, but I haven't got it figured out yet.) The query calls all the functions and pulls up...
3
5913
by: Marauderz | last post by:
Hello guys, got a little question regarding the regional language settings . Anyway I got a Windows 2003 Server machine that was installed with the date format "dd/MM/yyyy" and location still locked in US. As we migrated certain apps over to the new machine. we found out something... someone coded a Now.ToString in a database query... and the SQL Box is running MM/dd/yyyy! Chaos follows!!! I tried setting the Administrator account's...
0
1130
by: RadhakrishnanR | last post by:
HI ALL, My .NET application devloped in C# used mainly class file (OOAD) and user controls etc and it is desktop application not web based application. Database is SQL server 2000. Now I have problem in Date format. Scenario is : If my application is running in the following setup, i.e The SQL server2000 is installed with DDMMY format and system setting also DDMMYY. Now when the user enters the date like 19-04-2007 in the UI,it is...
5
1522
manoj9849967222
by: manoj9849967222 | last post by:
Hi All I have a problem with date format. I have designed a table with one of the field as Date. when i enter the date it is comming in mm/dd/yyyy format. Is there a way to change the format to dd/mm/yy format. Please help Regards Manoj
0
1369
by: mahesh123 | last post by:
Hi, I am new to use the crystal reports8.0. I am facing the problem regarding the database connection through the ADO Connection. Suppose my database name is "sample.pra"(due to some security reasons we will change the extension of the MS Access Database and there is a password for the opening the database). So that we cannot connect to the database. Please give the information regarding this problem as soon as possible...... Thanks &...
2
2709
by: akshaycjoshi | last post by:
Hi, I am developing one application which requires me to compare date.The dataabse being MS access 2003. When i execute the query in c# it does not show any record ,the date although matches with the date in database. Where is the problem ? The quey executed is select * from finetable where fine_date=#1/9/2008 6:46:36 PM# (The above date is entered by dateTimePicker)
3
1456
by: Jozo | last post by:
Dear All, This is my first time on this site and I am very happy! I have problem regarding to date (new or old ms access document) My problem is that access changes date after 09/11 to 11/09 i don't know why! I tried to change default date in windows but after that I have also problem with date! Please help me! If you have any questions, don't hesitate to contact me!
0
8189
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
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...
0
8497
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
7184
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
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...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
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

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.