Hi i am a beginner i am working on software site. i have built all the pages and layout for the site that was the easy part done using HTML CSS AND JAVASCRIPT alone, only thing left is to make main categories pages for different software which is tough for me.

i want to to add sorting option on category pages like this (See Here)
where user shall be able to sort software according to date, name, date added etc. and also be able to control max number of software to display like 20, 30, 100 etc.

On my HTML Page i have these div's in which i want to display data (different softwares)
from MySQL database "security_software" (it is a testing database) from table "internet_security" (it is a testing table)

First rule of ajax is to make the server side script (ie PHP) work and fully test it before moving on to consume it with Javascript. Your PHP won't work because you're ordering by a string not a field. Replace the single quotes with backticks and add a check so that it will only accept a predefined list of field names to prevent SQL injection. When you have that working you can rule out the PHP and debug the Javascript.
–
MrCodeMay 18 '12 at 11:10

I was about to write a long response, but MrCode is correct. You should ensure your viewers do not have Javascript enabled first and then once it's working, use Javascript to improve it.
–
GavinMay 18 '12 at 11:17

i forget to add backticks thanks for reminding, but it is not working.
–
user1275456May 18 '12 at 11:19

@Gavin if you can provide me your response it will be great help. as i am new i understant a little late, you guys just tell in a way that goes off my head
–
user1275456May 18 '12 at 11:21

What happens when you navigate to ajax.php?q=title?
–
MrCodeMay 18 '12 at 11:23

1 Answer
1

First thing worth noting is, if you are going to display tabular data... Use a table! It will make things a lot easier for you.

Secondly. Build your code and table as if Ajax did not exist. Initially populate the data using PHP on the page your displaying the data. Then, hook up the column header's so they link to your page, but passing which column you want to sort by and also which direction.