Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Php, Mysql and Ajax

Status
Not open for further replies.

akelabanda

Programmer
Dec 19, 2001
61
IN
Hello folks

I'm trying to create a new design for a php website to make it database driven (MySQL).

I can play around a bit with php and mysql but not really an expert. I'm seeking advice/tips on how best to achieve my site design (attached)

* Fig 1 shows the landing page with initial data
Left pane will display a list of categories from the
MySQL table. Each list item should be a link.
* Clicking on any link (Cat 1) should display Subcat1,
Subcat2, etc on the right. Each Subcat should also
be a link
* Again clicking on any Subcat should do 2 things. It
should move all previously displayed Subcats under
Cat as shown in the figure. It should display products
under Subcat on the right side. (All are links)
* Clicking on any Product link on right moves all product
links under Subcat and displays Product details on
right as shown in the figure.

How can I achieve this using php, mysql and ajax ?

If you need more details, do let me know. All this data will be sourced from a singe table.

Your help will be greatly appreciated.

UK's best mobile deals online
 
php is a layer that allows you to generate html dynamically. It can also interact with the system layer and mid-layer (databases etc) and do other things.
ajax is simply a method of getting javascript to talk to a server (php or whatever) without refreshing the page. it can also process requests asynchronously if you wish (which is helpful)

your question is too broad to answer in a forum such as this. the trite answer is that you would use assign ID's to each link before outputting them to the browser and then test the value of each incoming query string to see what ID had been requested and then act accordingly.

leaving ajax out of this (this is a php forum) your receiving code decides what the page should look like and outputs the html and css as appropriate. If you have issues with page design, address them to the HTML, XHTML & CSS forum.

with ajax you can retrieve data dynamically but then you will also have to build intelligence into your client-side code (javascript) to re-organise the page on the fly. For issues with javascript, talk to the Javascript forum. For issues with ajax generally, talk to the javascript or General Ajax discussion forum.

for particular_ questions with php, feel free to post back here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top