Jump to content

selecting top amount


KirstyScott

Recommended Posts

I'm trying to find out which people have the highest amount of a column in a table (by doing my code below), but each time i do this it displays the people with an amount in the column but dosen't order it by the column i want it too...below is my code  :-X

 

select top 15 COLUMN from TABLE order by COLUMN DESC

 

Anyone know where im going wrong on this? the table itself has around 9 columns in total if that helps anyone

 

And does anyone know how to insert a date using php into a database at the time it was inserted? ??? i'm just learning php as if you can't tell alrdy  :P i'll appreciate any help!

Link to comment
Share on other sites

unix_timestamps

 

Effective, efficient and easy.

 

time() will get you the current time and date in seconds (actually since unix epoch google it).

you can store the result in db.

 

then you can grab the date and time and format however u want to with date("d/m/y H:i:s",$old_timestamp);

 

Hope this helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.