Jump to content

Need help with getting the information to display in Alphabetical order


craigbruiners

Recommended Posts

This is the query:

 

$tech = "  select d.doc_id, d.doctype_id, d.doc_summary, d.doc_title, p.dpdf_name,

              doc.doctype_title, doc.doctype_img, doc.doctype_img_alt, d.doc_textversion

              from doctype doc,document d left join pdf p on d.dpdf_id = p.dpdf_id

              where d.doc_id='".base64_decode($_GET['id'])."' and

              d.doctype_id=doc.doctype_id order by d.doc_title asc";

 

Because at the moment it displays the results in any order.

 

Thanks in advance.  ;D

Link to comment
Share on other sites

doc_title contains just the names of different documents.

 

The original code is:

$tech = "  select d.doc_id, d.doctype_id, d.doc_summary, d.doc_title, p.dpdf_name,

              doc.doctype_title, doc.doctype_img, doc.doctype_img_alt, d.doc_textversion

              from doctype doc,document d left join pdf p on d.dpdf_id = p.dpdf_id

              where d.doc_id='".base64_decode($_GET['id'])."' and

              d.doctype_id=doc.doctype_id";

 

But i want it to display the documents in alphabetical order, so i added the order by like this:

$tech = "  select d.doc_id, d.doctype_id, d.doc_summary, d.doc_title, p.dpdf_name,

              doc.doctype_title, doc.doctype_img, doc.doctype_img_alt, d.doc_textversion

              from doctype doc,document d left join pdf p on d.dpdf_id = p.dpdf_id

              where d.doc_id='".base64_decode($_GET['id'])."' and

              d.doctype_id=doc.doctype_id order by d.doc_title asc";

 

So i added the "order by d.doc_title asc" coz i want it in alphabetical order.

 

Thanks again for your assistance, still new to all this

;D

 

 

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.