Jump to content

mb81

Members
  • Posts

    120
  • Joined

  • Last visited

    Never

Everything posted by mb81

  1. Laffin, all the logic might be there, but that doesn't answer my question. What you are giving me is a MySQL syntax that doesn't work with the way that I have decided to layout my application. There are a couple issues with that, first of all because even though someone might be there for 7 days, they might only be using a particular room or a particular resources for 1 or 2 days, but it needs to be attached to the original reservation, so I created a table that uses their reservation id, the date, and a resource id.
  2. Cool, never had to use that before, thanks for the info, I knew there was something I was missing. Thanks! SOLVED
  3. ok den, can you showz me howz to getz a SQL requrd set with all the dates between diz and dat? P.S. I didn't know we spoke lolCat here.
  4. Well, there's no special function per se, but you could do something like this: <?php $start = '2008-02-15'; $end = '2008-03-16'; $dates = array(); for ($ts = strtotime($start); $ts <= strtotime($end); $ts += 86400) // Add one day with each iteration { $dates[] = date('Y-m-d', $ts); } print_r($dates); ?> Can you give us a little more information as to what you are trying to do? I'm guessing there may be a way to do some of your calculating within MySQL instead of having to do this all in PHP. Obsidian, that's pretty much where I went with it also after a couple of trial and errors, I found that to be the easiest and cleanest.
  5. Here is my query: SELECT COUNT(*) AS countreservations,reserveddate,resourceid FROM RESERVATIONS_reservedresources GROUP BY reserveddate,resourceid ORDER BY countreservations DESC I want to get a set of results back where only where countreservations>1 is returned. If I try to insert WHERE countreservations>1, it says it doesn't know that column If I try to insert WHERE COUNT(*)>1, it says illegal use of group function Is there any way to get just the records that have 2 for the COUNT(*)? Thanks.
  6. I need to cycle through all the dates in a date range to test for availability. This is for an online reservation system (think like a hotel, one reservation per date).
  7. Given 2 inputs of a startdate and an enddate (in standard MySQL date format), does anyone have any better ideas on how to create an array of every date that is between these two dates? Right now, I am other than converting them to integers based on timestamp, then creating an array using range, then looping through and converting them back to mysql style dates. Is there a secret function I am missing or a trick someone has used?
  8. Look at BillyBobs solution above, this should work, I do the same thing with our content management system, and I have this line: RewriteRule ^([a-z]+)$ content.php?id=$1 [L]
  9. I have to do a lot of image and other media content uploads into folders, am I going to run into any trouble if I set the CHMOD on these to 777 or is there some other setting that will allow me to upload the pictures, and view them via the browsers, and potentially delete the images from the online management system without doing 777? Thanks!
  10. yes, it's also netstat, run it as netstat -b from the command prompt
  11. Leaving a rectangle 22 x H and a 6 - 8 - 10 rightangled triangle so $H = 8 * sin( asin(6/10) ); Are you sure that the resulting triangle from when you remove the center rectangle is a right triangle? I don't think that is going to happen in most cases, so I am not sure you can apply that to every case.
  12. Pixar uses Renderman - http://renderman.pixar.com/
  13. If you want it to happen automatically, you have to do a CRON job on your server. Depending on your host, you may or may not have access to that capability.
  14. It's not the picture that is causing the problem, it's the width of whatever is holding the picture. Something is not set right on the DIV or TABLE or whatever you are using to hold the picture.
  15. mb81

    mysql syntax

    So what's your question?
  16. Here's the long version of the formula. height = side1 * sine ( inverse cosine ( side1^2-side2^2-(top-bottom)^2 / -2 (side2) (top-bottom) ) ) side1 being one the length of one of the sides, side 2 being the length of the other side, top being the length of the top, bottom being the length of the bottom. THERE MAY BE ERRORS IN THIS WORK, DEFINITELY DOUBLE CHECK ME
  17. Use some creative geometry and the law of cosines If you draw two lines perpendicular to the bottom line segment that intersect the top vertices and put the triangle together, you have a scalene triangle with the following properies: base of 10 (difference between the top line segment and the bottom), one side of 6, and one side of 8. The law of cosines says: For a triangle with sides a, b, c opposite angles A, B, and C respectively then, a^2 = b^2 + c^2 - 2bccosA If your side a = 6, your side b=8, and your side c = 10, then 36 = 64+100-2*8*10cosA -128 = -160cosA cosA = 128/160 If you draw another perpendicular line down through the triangle from the top point to the bottom line, then you have a right triangle with a known angle and a known side. The sin of A will be equal to the opposite (the height of the trapezoid) / the hypotenuse , so the height of the trapezoid is equal to the the hypotenuse * the sin of A. Hope that helps.
  18. TimUSA, You might try some sort of percentage combo made up of your total score and your average score, where your average score makes up 80% and your total score makes up 20% of the overall score. Otherwise, you might try something using a standard deviation of the number of races participated in or something along those lines.
  19. you are saying "post back", I am saying "post back to the same page", not the same. This is my recommendation: If your form is in the file contact.php, you put your submit script at the top of that page, and you check to see if the form was submitted. If it fails, you simply assign the values sent (using $_POST['varname']) and then, display the form again, instead you assign the value of the field to whatever the varname is, that way, you don't lose any data.
  20. Why are the last 4 digits a random set of letters, why you don't label it with a date code (like 032708)
  21. Saving stuff into a database, then e-mailing out to people is about a 20 step process, nobody is going to help you with 20 steps right here, you need to get a tutor or find a tutorial or something, there's way too much information to cover here.
  22. I always post back to the same page so that I can check the response, then fall back on the form again if all the stuff isn't there.
  23. For purposes of SEO and content management, I use a simple rewrite code that takes a page name after a URL and send it as an id to the controller, like so: RewriteRule ^([a-z0-9]+)$ content.php?id=$1 [L] My challenge is this replaced a page structure that used files with similar names and a php extension, so I was trying to write a new rule that would take a URL like this: http://www.mysite.com/page1.php and change it to this: http://www.mysite.com/page1 So that it would match the pattern of the items above, so I wrote this line: RewriteRule ^([a-z0-9]+).php$ content.php?id=$1 [L] But, this tries to rewrite content.php, so I need to exclude the following names from that match: index,content,header,footer I tried a couple of different things, but couldn't get it to work, any help?
  24. Here is some code that will help: --With only 3 fields displaying, you don't really need a foreach loop to go through them, so below I broke out each of the fields --Each time you go through the while loop, line becomes an associative array, meaning the keys are the fieldnames, so $line['id'] is the id, $line['schoolname'] is the schoolname, etc. -- The link is created by putting the id in there, on the schoolinfo page, you will need to grab that id using $_REQUEST['id'] or $_GET['id'] variable, then use that to look up your school name and information. $query = 'SELECT id,schoolname, schoolcity, state FROM casestudies'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Printing results in HTML echo "<table class=\"sortable\">\n"; echo "<th>School Name</th> <th>School City</th> <th>State</th>"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "\t<tr>\n"; echo "\t\t<td><A HREF='schooinfo.php?id=".$line['id']."'>".$line['schoolname']."</a></td>\n"; echo "\t\t<td>".$line['schoolcity']."</td>\n"; echo "\t\t<td>".$line['state']."</td>\n"; echo "\t</tr>\n"; } echo "</table>\n";
×
×
  • 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.