Jump to content

shlumph

Members
  • Posts

    575
  • Joined

  • Last visited

Everything posted by shlumph

  1. Your code flow continues after this block: if (strlen($pwd)>25||strlen($pwd)<6) { echo "<p class='warning'>password must be between 6 and 25 characters</p>"; } else { //register the user echo "<p class='success'>Thanks for signing up!</p>"; } Try adding an exit, or die statement: if (strlen($pwd)>25||strlen($pwd)<6) { echo "<p class='warning'>password must be between 6 and 25 characters</p>"; exit; } else { //register the user echo "<p class='success'>Thanks for signing up!</p>"; }
  2. From what I gather, you are probably wanting to group by the teamid. But, since you're already filtering out all the other teams except the one you want, you don't need the GROUP BY clause. That is what you want, right? The number of online members from a certain team?
  3. You could make the invoice number auto increment via MySQL table settings, then you won't have to worry about having a function handle it.
  4. Turning error reporting on will help, as Maq suggests
  5. shlumph

    Join Issues

    Try pasting the echoed query out into your favorite MySQL editor and see if it gives you any errors, or the results you expected. It might be a logical error. I'd make any needed tweaks in the MySQL editor until you get what you want then move it into your PHP file.
  6. shlumph

    Join Issues

    Your parenthesis are wrong, which is why $new_fav isn't a valid resource. Change $new_fav = mysql_query("SELECT favourites.*, club_category.* FROM favourites INNER JOIN club_category ON favourites.favourite = club_category.catID WHERE favourite.memberID = ".$User['memberID']." " or die(mysql_error())) ; to $new_fav = mysql_query("SELECT favourites.*, club_category.* FROM favourites INNER JOIN club_category ON favourites.favourite = club_category.catID WHERE favourite.memberID = ".$User['memberID']." ") or die(mysql_error());
  7. shlumph

    Join Issues

    Sounds like you have errors turned off. Try this to get the error message: error_reporting(E_ALL); ini_set('display_errors','On'); $new_fav = mysql_query("SELECT favourites.*, category.* FROM favourites INNER JOIN category ON favourites.favourite = category.catID WHERE favourite.memberID = ".$User['memberID']." ") or die(mysql_error());
  8. You could check out Doctrine's DBAL: http://www.doctrine-project.org/projects/dbal
  9. shlumph

    Join Issues

    Try this to get the error message: $new_fav = mysql_query("SELECT favourites.*, category.* FROM favourites INNER JOIN category ON favourites.favourite = category.catID WHERE favourite.memberID = ".$User['memberID']." ") or die(mysql_error());
  10. If it's the same instance, you *can't* compare them. Which is what you need to do. There's plenty of ways. Note that after you create a horse you can get their attributes: $mix=rand(2,6); $a=new Horse; $a->create("Dave", 2, $mix); echo $a->agility; I would probably create a getPoints() function in the Horse class, which you could then call: class Horse { //... public function getPoints() { return ($this->strength + $this->speed + $this->agility); } } I would also create a compareTo(Horse $horse) method that would get the total points from the horse in the first parameter and compare it to the current horse. I did read your whole post. You need to follow what they are saying before you get any more help.
  11. No, it's the same horse instance. Like thorpe mentioned, you're just changing the horses name and age. If you create different instances for each horse, you can compare the instances with each other.
  12. Here's one way to do it without using variable variables: foreach ($_POST as $key => $value) { $_POST[$key] = filter($value); print "{$key} is {$_POST[$key]}<br />"; }
  13. Two options are is_int() or using a regular expression. Edit: is_int() not is_integer()
  14. It's showing your information, because more than likely, when you authenticated with the app, you set $_SESSION['id'] to your user ID. You'll need to figure out how to change this: $result = mysql_query("SELECT * FROM myMembers WHERE id='{$_SESSION['id']}'") or die(mysql_error()); To grab information from user you want. Hint: You'll want to get rid of $_SESSION['id'] above, and make an $id variable from somewhere else.
  15. Perhaps you are looking for something like this: $result = mysql_query("SELECT * FROM myMembers WHERE id='{$_SESSION['id']}'") or die(mysql_error()); echo "<table border='0'>"; echo "<tr> <th>Name</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['account_name']; echo "</td><td>"; } echo "</table>"; ?> Which would (I'm guessing) print out all of the account names from $_SESSION['id']. And if there's only one account per person, then you don't need a while loop.
  16. Is there something specific that you are trying to do with this query? That query would always return the same account name. You're getting the "Resource id #21" etc, because mysql_query() return a resource. echo mysql_query("SELECT account_name FROM myMembers WHERE id='{$_SESSION['id']}' LIMIT 1"); From your description, it's not needed, and all you need to do is this: // Print out the contents of each row into a table echo "<tr><td>"; echo $row['account_name']; echo "</td><td>";
  17. You could take a look at cURL and xPath, however, I wouldn't be surprised if those sites would block you after doing so many frequent page requests.
  18. You don't need to extend the emailClass to get it's functionality, you can always inject it into the userClass. Or have some sort of email factory and pass it a userClass object. There's a lot of different solutions that involve composition rather than inheritance
  19. You're very close: $this->getForm()->getElement('ElementName')->setAttrib('onClick', 'something'); http://framework.zend.com/apidoc/1.11/Zend_Form/Element/Zend_Form_Element.html#setAttrib
  20. In the controller you can access it via $this->getRequest()->getPost('name');
  21. You'll have to look into setting up wildcard subdomains on your web server, and also for your DNS.
  22. You're doing something wrong. But if you post the relevant code we can probably help you out. In general practice, information retrieved via $_GET should only be used to display certain information. Not really used for inserting.
  23. What's the name of the column? You'll want to order it with your MySQL query, just like you ordered the day. order by day asc, time asc
  24. I believe you'll have to implement your own function to organize the array like that, after getting the data from MySQL.
×
×
  • 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.