Jump to content

wemustdesign

Members
  • Posts

    106
  • Joined

  • Last visited

    Never

Everything posted by wemustdesign

  1. Hi, I have a database that contains the following tables: - State - Town - Zip Code I have a searchbox, when a users submits I want to search all 3 tables for a match. What is the best way of doing this?
  2. Thats on the same lines as I was thinking about doing it, I didn't want to jump in though. Thanks for the reply
  3. You need to wrap them in a div #tabsWrapper{ width:1000px; margin:0 auto; } you may also want to add a width for the .tab class
  4. Its going to be a little bit like a estate agent/ real estate website, so the shortlist will hold as many as they add really. To save the shortlist they have created they will have to register but they can initially use the system while they are browsing the webiste for the first time.
  5. I am creating a 'add to shortlist' feature where users can add items to be viewed later. I don't want the user to have to register to use this feature. What would be the best way to store these items; in a database, cookie or in a session (and maybe save to a database if they register)? It is basically going to work similar to a shopping cart just without the checkout stage and prices
  6. form.php (just a normal form) functions.js $(".submitLocation").click(function() { var name = $("#name").val(); var dataString = 'name=' + name; $.ajax({ type: "POST", url: "updateDatabase.php", data: dataString, success: function(){ $('.success').fadeIn(200).show(); } }); updateDatabase.php this is just a simple php file which inserts the data sent Basically what I want is to add a 'step 2' of the form. This is where the user can add photos to the listing. To do this I need to get the 'name' that the user submitted in form.php.
  7. My whole webiste is based around Google Maps and is loaded full of JS so if they do not have JS turned on they will only get a noscript error message
  8. I have created a form, basically this is the data flow - Form.php Passes the data to - Functions.js This validates the data etc If valid passes the data to - updateDatabase.php Adds the values from the form to the database Now I want to display the data on the original form page (form.php). I have tried the get 'Functions.js' to pass the data back to 'form.php' but can't get it working. Can anyone reccomend a way to do this or can point me in the direction of a related tutorial?
  9. I have a category table to categorise all of my subjects. This way they can output (when I get it working) in a category structure and will be used for other things as well. Animals (Cat) Tiger (Subject) Birds Lion Buildings (Cat) Castles (Subject) Church
  10. Hi, Thanks for the reply, yes I am going to code this in PHP. I know you can order by 2 columns but how would this work is what I am wandering? So if I 'ORDER BY name ' for the categories how do I then output all of the subjects under that category before the mysql outputs the next category? This is the part I cannot get my head round?
  11. What I don't understand is the order by bit, how would I output 'Animals' cat and then all of the animals from a different table and then 'Buildings' cat and all the buildings from another table. How would I create this kind of order?
  12. Hi, I have two tables and I am wanting to output them all on a page but I would like to do this by sorting them by cat name so would look like: Animals Tigers Dogs Buildings Castles This is how I have my tables set up: tbl: subject id name cat 1 Tigers 1 tbl: cat id name 1 Animals any ideas are much appreciated
  13. Solved: Changed WHERE to HAVING
  14. I know I do not have a distance column, I am using the calculation as distance AS distance FROM `location` WHERE distance <
  15. Hi, I am using this query to list the closest distances to a certain lat/ lon $qry = "SELECT *,(((acos(sin(($lat*pi()/180)) * sin((`lat`*pi()/180))+cos(($lat*pi()/180)) * cos((`lat`*pi()/180)) * cos((($lon- `lon`)*pi()/180))))*180/pi())*60*1.1515) AS distance FROM `location` WHERE distance <= 10"; I am getting an error: Unknown column 'distance' in 'where clause' Can anybody see what the error is?
  16. I have 3 tables for my website, Locations, Attractions and Location_Attractions (stores which attractions can be found at the different locations) I am Locations id name 1 Las Vegas Attractions id name 1 Casino 2 Hotel Location_Attractions location_id attraction_id 1 1 1 2 trying to get my head round how I perform a query to show which locations a certain attraction can be found at. For example on the Casino page I am going to list oll of the locations this can be found at. So I know I need to query Location_Attractions to find all of the locations that have the correct attraction_id (eg 1 for Casino). I then need to link this to the Locations table to retrieve the details about the locations (such as name, address). Any idea how I would do this, would I use a JOIN?
  17. Thanks for your help, I have chage my setup think this will work much better in the lonrun
  18. Hi, Thanks for the reply. The only problem is that there are multiple rows in the MySQL table so need to explode all of the values from the attractions column for every row and then add this all up. Las Vegas 3|67|7|89 New York 3|67|89|43 LA 2|67|77|8 So this would some up (id 3)Casinos (2) (id 67)Cinemas (3) I just can't get my head round how I would go through each row and add all these values up. Is the method I am using storing them as 56|78|3|4 the best way to do this do you think?
  19. Hi, I am creating a webiste about places to visit. Now each place can have different attractions, and I have stored these attractions as follows: Location Las Vegas Attractions 3 | 6 | 7 | 10 The attractions data is the reference to the id of a certain attraction. What I am looking to do is create a total of all all of the locations that have a Casino (id: 3) for example I know I have to explode the Attractions but then how do I query for id=3 for every row? If someone could just point me in the right direction i would be over the moon!
  20. I am using fluster to cluster my Google Maps pointers I am getting an error in the code highlited below: Full code: function initialize() { // Create a new map with some default settings var myLatlng = new google.maps.LatLng(54.329338, -3.186035); var myOptions = { zoom: 6, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); fluster.addMarker(marker); var point = new GLatLng(54.787918,-1.491244); var marker = createMarker(point,'hello'); Any idea what the error is, not too good with javascript
  21. So I have altered the code and have now added the below but am getting an error at the line highlighted below? Full code: function initialize() { // Create a new map with some default settings var myLatlng = new google.maps.LatLng(54.329338, -3.186035); var myOptions = { zoom: 6, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); fluster.addMarker(marker); var point = new GLatLng(54.787918,-1.491244); var marker = createMarker(point,'hello');
  22. Thanks very much for your reply, I am going to go and text this now!
  23. I don't know much javascript and am trying to cluster my points on a Google Map (using Fluster). Below is the example that generates some random points on a map: // Create a new map with some default settings var myLatlng = new google.maps.LatLng(25,25); var myOptions = { zoom: 6, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); // Initialize Fluster and give it a existing map var fluster = new Fluster2(map); for(var i = 0; i < 200; i++) { var pos = [ 50 * Math.random(), 50 * Math.random() ]; // Create a new marker. Don't add it to the map! var marker = new google.maps.Marker({ position: new google.maps.LatLng(pos[0], pos[1]), title: 'Marker ' + i }); // Add the marker to the Fluster fluster.addMarker(marker); } Below is how I usually add points. How do I use the above code to add markers, not sure where to add the Lat and Lon for the different markers. map.addOverlay(marker);var point = new GLatLng(54.65246,-2.17804); var marker = createMarker(point,'<b>High Force Waterfall</b><br /><img src="/images/map_force.jpg" style="float:left; margin-right:4px;" /><div style="background: url(/images/map_logo.jpg) no-repeat top; float:left; font-size:8.5px; padding-top:30px; width:74px; line-height:10px;"><a href="/venues/venuename/High-Force-Waterfall">Find out more about this venue</a></div><br /><div class="clear"></div>'); map.addOverlay(marker);var point = new GLatLng(54.787918,-1.491244); var marker = createMarker(point,'<b>Hallgarth Manor</b><br /><img src="/images/hall.jpg" style="float:left; margin-right:4px;" /><div style="background: url(/images/map_logo.jpg) no-repeat top; float:left; font-size:8.5px; padding-top:30px; width:74px; line-height:10px;"><a href="/venues/venuename/Hallgarth-Manor">Find out more about this venue</a></div><br /><div class="clear"></div>'); Gratefull if someone would point me in the right direction.
  24. Hi, I am wanting to create a piece of text that changes when a user types something into a text box on a form. You may have seen this on design your own greetings cards sites. You type in the message and it updates the preview automatically. Just looking to be pointed in the right direction, have searched the net for tutorials but aint found nothing. Thanks, Chris
  25. That worked a treat, thanks for taking the time!
×
×
  • 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.