Jump to content
Sign in to follow this  
hasmilia

Sorting Dlm Php

Recommended Posts

kenapa kalu saya run sql statement ni dia x paparkan ikut turutan...

$sqldb = "SELECT harga,tempoh FROM $noSebutHarga ORDER BY harga";

input

22

111

55

333

output yg keluar(slh)

111

22

333

55

output sepatutnye

22

55

111

333

ada sesape yg leh bantu x??

Edited by hasmilia

Share this post


Link to post
Share on other sites

22,111,55,33t tu semua dlm field harga ke?

try 'SELECT harga,tempoh FROM $noSebutHarga ORDER BY harga ASC'

pastu

'SELECT harga,tempoh FROM $noSebutHarga ORDER BY harga DESC'

cuma kame sure "ORDER BY harga" filed yg betul kita nak sort...

Share this post


Link to post
Share on other sites

ha'ah dia dlm field harga...sy da try da mcm yg ejoe suh...tapi still xboleh...bila tukar kpd DSC...

output dia jd

55

333

22

11

Edited by hasmilia

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...