473,395 Members | 1,383 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,395 software developers and data experts.

How to retrieve date from mysql database in php?

127 100+
i have table cresults.

Expand|Select|Wrap|Line Numbers
  1. email    marks    last_submit
  2. pooja23@gmail.com    9    2013-05-24
  3. rajletsgetlost@gmail.com    5    2013-05-24
  4. romancingtherain@gmail.com    5    2013-05-24
  5. vidhya.vs@gmail.com    8    2013-05-24
  6.  
Expand|Select|Wrap|Line Numbers
  1. $sql1="SELECT * FROM cresults where email='$login_session'";
  2. $result1=mysql_query($sql1);
  3. $last_submit=mysql_result($result1,"last_submit");    
  4.     echo " $last_submit";
  5.     if($last_submit==$today)
  6.     {
  7.         echo"you have already submitted";
  8.     }
but this code
Expand|Select|Wrap|Line Numbers
  1. echo " $last_submit";
not displaying the date. it displaying the email id. why? whats wrong in the code?!

if i use like this
Expand|Select|Wrap|Line Numbers
  1. $sql1="SELECT last_submit FROM cresults where email='$login_session'";
it works fine...
why?!
May 24 '13 #1
0 1740

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

Similar topics

1
by: Wild Child | last post by:
Hi, I am trying to find ways to retrieve data by date from a mysql database. What I would like to do is to have the option for people to retrieve a file that was entered in the week before the...
8
by: paul | last post by:
Hi everyone, I've just started using php, and although I am very impressed by it, there are some things with which I am confounded! What I'm trying to do is read in a Date from a mySql database...
13
by: John | last post by:
First I'll answer "why". Because, while SQL Server is available, it is also "expensive". MySQL is CHEAP and a lot more robust than Access. Is there a way to add, update, retrieve, and delete...
10
by: Krakatioison | last post by:
Hi everyone, can someone point me to download of an example for saving and retrieving to/from MYSQL database. Or did anyone of you tried this and could share your code with me. I've got some data...
2
by: michele | last post by:
Hi, I want to load a listbox with the date that are stored in a database (mdb), the problem is when I retrieve the date it has a format like "01/01/2006 0.00.00". In Access the date is stored as...
7
by: asenthil | last post by:
Hai to all, this is senthil... i'm now working in the field of VC++... i want to connect a mysql database... just now tried to retrieve rows from a simple mysql database by using VC++ My...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
3
by: subho2009 | last post by:
Hello friends, I have face a problem, the problem is that when i fetch data from mysql database i get '&' in the place of '&'. I am using php 5.1.2 and mysql version 5.0.11-beta. What is the...
4
by: Gary Baardman | last post by:
I am having a few problems returning records from a mySQL database using PHP. Firstly I must say I am trying to create a video album using MySQL, PHP and using pagination. My first problem is...
0
by: Kim Charlene | last post by:
Hi, guys! I've created a java servlet where I can upload video with limited size. The video uploaded is being saved in the mySQL database as BLOB. How can I retrieve that BLOB and display it as the...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.