| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
bubbles bubbles
|
AJAX Dynamic Page Load
Hi everybody, I'm having trouble finishing my website. I'm looking to load new php pages in a div with AJAX without refreshing the whole page. I've tried some scripts but none of them work as they should. Does anybody know where to find a proper working script. Thank You |
|
|
|
|
|
#8 (permalink) |
|
bubbles bubbles
|
Ok I got it. I needed to include a table before importing the file in the div. The website is torontonightlifespecialists.com/test_new Now I'm wondering why does it take so long to run my search queries under the club list category at the bottom. *note the website does not have a header yet*. One more thing, all my searches seem to be fine with the exception of 'Bar'. I am performing a full text search in mysql and the only word that it can't find is 'Bar' even tough the other searches are fine. |
|
|
|
#9 (permalink) |
|
bubbles bubbles
|
The website is Toronto Nightlife Specialists Now I'm wondering why does it take so long to run my search queries under the club list category at the bottom. *note the website does not have a header yet*. One more thing, all my searches seem to be fine with the exception of 'Bar'. I am performing a full text search in mysql and the only word that it can't find is 'Bar' even tough the other searches are fine. Last edited by pasky : 30-11-2007 at 11:26. |
|
|
|
#10 (permalink) |
|
Everything is fine.
|
I'm not sure how your database is layed out but by the sounds of it you have a field like 'type' or something where the record has a value of (for example): Restaurant - Lounge - Supper - Club - Nightclub Is this where you are performing your full text search ? If so, it would be more elegant and better to normalize your data by making a new table and giving each type an id and then creating a 'linked' table where each club is linked to each unique type in the 'type' table. You would then simply perform a SELECT WHERE type = x and LEFT JOIN the 'venues' table (for example) to the results. This should be more efficient and perhaps a little quicker than performing the full text search. You may also overcome your 'Bar' search issue this way, although I'm not sure why that's occurring currently. If you need further help, then let me know and I'll post up a sample database schematic for you. - Mike |
|
|
|
#11 (permalink) |
|
bubbles bubbles
|
Thanks you very much for your input Mike. It sounds to me like a sound solution the only reason I didn't do that was because I was lazy and didn't want to re-write anything in the database tables. Now let me see if I got this. 1. Create a table with the particular types that each club can have giving them a unique id. 2. Link the types table with my clubs table and associate the clubs with their various types. (this I am not to clear how I should go about doing it) Other than that I'm psyched, let's get these tables rolling :P |
|
|
|
#12 (permalink) |
|
Everything is fine.
|
Right then, let's see if we can break this down into bite-size pieces. Below are the 3 tables necessary to perform the join as I described in my previous post: Table 1 - types ID|type 1|Nightclub 2|Club 3|Lounge 4|Bar 5|Restaurant 6|College 7|Supper ... Table 2 - venues ID|name|address|features 1|Afterlife Nightclub|250 Adelaide St. W, Toronto|Patio,Smoking,ATM 2|Blue Suede Sues|75 Watline Ave., Mississauga|25 & Over Crowd,Smoking Area,Patio 3|Blurr Nightclub|214 Adelaide St. W, Toronto|N/A 4|Blvd Room|81 Peter St., Toronto|ATM,Smoking,Patio ... Table 3 - venueTypes typeID|venueID 1|1 1|2 1|3 1|4 4|4 ... Basically what happens is that you create the table that contains the Types that the venues may contain. Your next main table is the big one that lists the actual Venue information such as Name & Address etc. The 3rd table is the 'linked' table that joins each venue to its unique feature(s). All you do is create 1 record in the venueTypes table that points to the Venue ID (venue.ID) and the Type ID (type.ID). Both of these fields can be an auto_increment field so that the IDs get assigned automatically or you could manually create them yourself. You could then build a nice web interface that could easily CREATE or DELETE types from each venue from the venueTypes table where necessary. To perform the search you would then do a SELECT query such as: SELECT * FROM venueTypes WHERE typeID = x You will need to peform two table joins in the query to bring back the additional information such as Name, Address etc as well as the type name. I'll leave that last part up to you. If you get stuck or need further help then post a reply or contact me via MSN and I'll do my best to help you out. Good luck with it all. - Mike PS: You could also go further and put the "Towns" in to a seperate table too. |
|
![]() |