0

advnc thank u..
i need to access login details(date and time) of users while clicking on calendar type date. is it possible? date and time is inserted in database while each userlogin. please help me...:(

6
Contributors
20
Replies
91
Views
4 Years
Discussion Span
Last Post by diafol
Featured Replies
  • 1
    diafol 3,720   4 Years Ago

    Ask your questions anyway, this is a help forum after all. What you're looking for is a trivial piece of code, so I'll outline what I'd do... 1. Get a calendar (or datepicker), such as jQueryUI 2. Either via Ajax or normal form submission, send the date to the server … Read More

  • 1
    diafol 3,720   4 Years Ago

    Again, **please post your code**. Your reticence with regard to this matter is frustrating and not helping you at all. We can't get a handle on what the problem may be from your cryptic messages. Read More

0

Keep in mind that many people are in a different timezone than you and are sleeping. Wait a few days or so before bumping the thread.

0

Hai;

You can do this. Get the date from the date field and set the select query like "SELECT * FROM db_usertable WHERE DATE(LastLoginedField) = '$yourDate';"

Edited by Bachu: text correction

0

i need php code for this..please help mee

So... what have you tried exactly? No one is going is to just write free code for you. if that is the case, you should need be a code/programmer.

We would help more in depth but you don't have any evidence of efforts anywhere.

Oh and btw, this may help: ajax calendar

0

sorry n thnks

Anyways, have you found a solution to your problem or do you still need help?

0

Anyways, have you found a solution to your problem or do you still need help?

I'd wait - you told her to show some effort. ;)

0

I'd wait - you told her to show some effort. ;)

Hehe, that's true. we will wait.

0

No need..thnks i'l work hard..:)

Now that's the spirit, feel free to ask questions (if your efforts are evident :D)

1

Ask your questions anyway, this is a help forum after all. What you're looking for is a trivial piece of code, so I'll outline what I'd do...

  1. Get a calendar (or datepicker), such as jQueryUI
  2. Either via Ajax or normal form submission, send the date to the server
  3. The server picks up the date, let's say as $_POST['date']
  4. If you use mysql_* functions, you'll need to sanitize the data, not if using data binding with mysqli_* or PDO.
  5. Anyway your SQL query (for mysql_*) will probably look something like this...

    SELECT username, TIME(logindatetime) FROM login_log WHERE DATE(logindatetime) = '$inputdate'

...which will give you the name and time(s) that the users logged in

Loop through the resultset in order to create your display.

Edited by diafol

0

i have tried this..but the pblm is, i entered the datetime in database by using now() function and the format is in (yyyy-mm-dd time). But from the web browser am geting the date as (mm-dd-yyyy) in the format. So that am not able to compare the date and access the row from database while using select query..is there any other function to be store curernt date time in database? thnk u in advnc..sayy an advice too..

0

Either change the datepicker settings to give you datetime format of Y-m-d (yyyy-mm-dd) or convert the m-d-Y format, e.g.

$date = DateTime::createFromFormat('m/d/Y', $dateFromPicker);
$convertedDate = $date->format('Y-m-d');
0

while am picking date from that picker am gtng the above error..cant able to store that date to tha variable.

Attachments Capture.JPG 33.44 KB
0

For future reference, show your code too as the screenshot is not helpful.

If you are getting this error from the DateTime snippet it could mean that your php version is old and doesn't fully support DateTime and its methods.

0

yeah i think so..but now its ok..i changed code..thnk u..:) is there any method of getting a variable in one page to another page ? include() metho di tried..bt session key error arising

1

Again, please post your code. Your reticence with regard to this matter is frustrating and not helping you at all. We can't get a handle on what the problem may be from your cryptic messages.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.