Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. neil.johnson I think he's past that part and has stored the values in the database already.
  2. It might help to put a marker in between the digits, so you can use explode. Such as a . 1.2.3.4.5 or 1.2.4 you can explode on the . and then you'll have an array of all the digits.
  3. What is the question? You posted code which appears fine. Where exactly are you having trouble?
  4. If you print the text one way in the actual page, you'd do the exact same thing in the title.
  5. I'm a dog trainer now. Last night I started working on my first programming project since November.
  6. Actually I did it differently than I thought a minute ago. This looks like it works as far as I can test it now. Anyone see a problem? //Distance between start and end in rows and columns $rowDist = abs($row-$dr); $colDist = abs($col-$dc); //the diagonal moves needed is the smallest difference of these two $diagNeeded = min($rowDist,$colDist); $distance = $rowDist+$colDist-$diagNeeded; It works perfectly for all the spots I have in my matrix, I'll post again if I find it doesn't work later.
  7. I think I have it...working on a while statement
  8. I have a 5x5 grid, stored in a multidimensional array. I have some objects in various spots on the grid. Imagine like a chessboard, each spot in the matrix is a square. I want to find how many "moves" basically between two spots. What I have now is the row and column numbers for each object, and I can figure out how many straight moves (up, down, left, right) it would be. But I want to account for diagonal. So if an object is in 3,3 and another in 5,5 that's only 2 moves. But I can't seem to figure out how to account for this in the code. If we have 3,3 and 4,5 - that's down one, over two, so I can see that's 3 moves. Or, 2 moves if we can use diagonal. Having trouble when to subtract moves for diagonal moves. Send me in the right direction? This is more a theory problem than actual code, but if you need code I can post something.
  9. I've tried all the ways I can think off, can't get the month name to center. Example: http://client.creativxchange.net/development/VBC/calendar-of-events/ HTML Snippet: <div id="calendarModule"> <table class="month" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="left" style="text-align: right;"> </td> <td class="monthName" align="center" style="text-align: center;" colspan="5">July</td> <td class="right" style="text-align: left;"> </tr> ... </tbody> </table> </div> CSS: /* Calendar */ #calendarModule{ color: #FFFFFF; font-size: 1em; } #calendarModule table{ border-left: 1px solid white; border-top: 1px solid white; margin: 5px auto; } #calendarModule td, #calendarModule th, #calendarModule p{ width: 80px; vertical-align: top; } #calendarModule .day, #calendarModule .nonDay{ height: 80px; border-right: 1px solid white; } #calendarModule th{ border-right: 1px solid white; } #calendarModule td, #calendarModule th{ border-bottom: 1px solid white; } #calendarModule .right{ border-right: 1px solid white; } #calendarModule .event{ width: 75px; margin: 0 5px 5px 5px; } #calendarModule .dayNum{ width: 16px; height: 16px; border-right: 1px solid #FFFFFF; border-bottom: 1px solid #FFFFFF; margin: 0; padding: 2px; text-align: center; vertical-align: center; color: #FFFFFF; font-weight: bold; background: #872e1d; } #calendarModule td.monthName{ text-align: center; font-weight: bold; font-size: 14px; }
  10. Heh, I think I would just confuse people
  11. I just started using CakePHP after trying a bunch and I like it. They were making a good point. keeB's analogies were dead on. It's hard to make a specific recommendation based on the requirements you gave. I personally don't think a framework makes your site smaller, it makes it LARGER as you need all their files. I also don't think they make anything faster at first because you have to learn all this new code. But in the long run they can help, and I am enjoying delving into CakePHP.
  12. Awesome, the only thing I had to do was add the brands.* to get the actual brand info. SELECT food.*, brands.* FROM food LEFT JOIN brands ON food.brandID = brands.brandID
  13. Hey guys. I am trying to get info out of a database. There is a table of "foods" and a table of "brands". Some foods have a brandID, and some don't (0). I want to select all of the foods and their brand. The problem is when I do this: SELECT food.*, brands.* WHERE food.brandID = brand.brandID I don't get the food items that don't have a brand. The obvious solutions is to do 2 sql statements, selecting the foods and then the brands, then using PHP to put them together. But, is there a way to do it in one statement? Thanks!
  14. You'd use a recursive function to handle replies to replies to replies, etc. Use if statements to decide if they are a comment. Just start working on it and if you get stuck, post for help!
  15. My husband suggested someone might have access to the DB and just be running an SQL query. I'm sure you have, but have you changed the passwords and usernames for the db? There might be a backdoor in the code, the version is like a year old. *shrug*
  16. header('Location: '.$url); If you're doing it after the page has loaded you'll need to use javascript, but that's not the best idea.
  17. Uhm...so someone PMed me to tell me to check my profile, and I was pretty sure I had changed it - but I went in to do it again and actually it's back. When I did change it I added two more sites to my sig, my consulting site and my blog - and the darkmindz urls are back again. So looks like the problem still exists. Also they changed the title of the site to Web Hacking instead of my title.
  18. The name of the box needs to have [] after it. That will give you your array. Then use implode.
  19. lol revraz you are much more observant than me today I am starting to feel pretty dumb.
  20. Yep, those errors are really handy. The error you saw was probably about your post vars. Maybe you misspelled one form elements name? That could cause an error that would be hard to catch without all that error reporting.
  21. Actually, <?php if(isset($_POST['name'])){ $name=$_POST['name']; echo $name; } ?> is more correct and will not trigger a warning.
  22. Put the query in a string as a variable and then print it. <?php $sql = "UPDATE Endorsementlog SET end='$dorse' AND end1='$dorse1' AND end2='$dorse2' WHERE Student='$student' AND Endorsement='$lic' AND Date='$today''; print $sql; mysql_query($sql) or die('Cannot inset into Endorsementlog table. MySQL Returned: '.mysql_error())"; ?>
  23. You should still change it, it's bad practice. Add this to the top of your code: ini_set('display_errors', 1); error_reporting(E_ALL);
×
×
  • 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.