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...:(

Recommended Answers

All 20 Replies

i need php code for this..please help mee

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.

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';"

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

sorry n thnks

sorry n thnks

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

Member Avatar for diafol

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. ;)

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

Hehe, that's true. we will wait.

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

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

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

:'(

commented: Moi c'est habib Hassaballah+23599954219 +0
Member Avatar for diafol

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.

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..

Member Avatar for diafol

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');

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

Member Avatar for diafol

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.

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

Member Avatar for diafol

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.