Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Everything posted by marcus

  1. Put the $datetoset in quotes in your $sql variable. So: $sql = "UPDATE `needs` SET `completiondate`='".$datetoset.'' WHERE `ID`='".$id."'";
  2. This isn't a PHP problem. Avoid using the same ID multiple times. You have "#image_rotate" used twice, jQuery is going to confuse itself. If you want to use a layer multiple times make it a class. I would suggest renaming both IDs to something like. <ul id="gallery1"> and <ul id="gallery2"> Then you should be able to use $('#gallery1, #gallery2') in your jQuery script.
  3. Looks like you have a MIME type problem. It's not recognizing the .php file extension as a PHP document.
  4. http://lmgtfy.com/?q=php+file+upload+tutorial
  5. Just starting the path with a forward slash puts you in the root directory. So the full path would be something like: /home/user/public_html/path/to/assets/init.inc.php
  6. When dealing with multiple where clauses you need to use AND and/or OR to separate each clause. $sql = "DELETE FROM `x` WHERE `y`='z' AND `z`='y'";
  7. 1814400 = 3600 * 24 * 21 = 3 weeks in seconds.
  8. $ASLconfirm = date("l, F j", strtotime($ASLdate) - 1814400);
  9. Is it not obvious? You're passing testvar, but looking for testurl.
  10. To get the ?url=<blah> from your code you use the superglobal $_GET and index it with url. So on the second page you just have $url = $_GET['url']; if(isset($url)){ echo $url; } else { echo "sorry dude"; }
  11. You don't have a name to your submit button. <input type="submit" name="Submit" value="Query" /> You should also look into using a switch statement. switch($_POST['query']){ case 'add_status': // code break; // etc default: // if no option is selected }
  12. This isn't really a relevant PHP question, more-so JavaScript. I made a mock-up of an idea you might want: http://jsfiddle.net/DLVzN/ If you click on a number it highlights all the numbers less than or equal to it, else it keeps it blank. So you could add more attributes to the span if you wanted to include the movie ID and use var rating as the rating.
  13. Why don't you just do if(!$_SESSION['currentMember']){ // redirect }
  14. Ok, well in your if statement you're doing an assignment, not a comparison. if($a = $b) is not the same as if($a == $b)
  15. Functions are public without any cast. class A { public $user; public function __construct(){ $this->user = 'apple'; } function getApple(){ return $this->user; } } class B { public $user; public function __construct(){ $a = new A(); $this->user = 'b' . $a->getApple(); } function getApple(){ return $this->user; } } $b = new B; echo $b->getApple(); This code would return bapple. If the getApple() method in A was private, B would not be able to access A's getApple() method. However, if A's getApple() method was protected, and class B extends A, then you would be able to access A's getApple() method.
  16. Is $this->collection->findOne(array("Username" => $this_username)) supposed to be returning a username, or an object?
  17. array(min($player->hp + $healspell, $whatEverYourMaxHPValueIs), 'etc....')
  18. function findIndex($array, $value){ if(count($array) > 0){ $i = 0; foreach($array AS $val){ // check if val is equal to value, if it is return $i // increment $i } } return -1; } Alternatively you could use a for loop $count = count($array); for($i = 0; $i < $count; $i++){ // if array position at $i equals your value, return $i } -1 is used to indicate the value was never found. So when using the function $index = findIndex($array, $value); if($index < 0){ // not found }else { // found at $index }
  19. SELECT CONCAT_WS('~',x,y,z) AS xyz FROM table CONCAT_WS is a mysql function for concatenating fields with a separator. So when you execute your query you would be able to use $row['xyz'] as x~y~z
  20. $cur = "2012-04-20 14:25:50"; echo date("m/d/Y H:i", strtotime($cur));
  21. you would do (inside your while loop) $sel = ($_SESSION['type_of_work_id1'] == $rowt['id']) ? " SELECTED" : ""; echo "<option value=\"".$rowt['id']."\"".$sel.">".stripslashes($rowt['title'])."</option>\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.