Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. What happens when you just do SELECT * FROM user_registration_details WHERE username = 'testaccount'; ?
  2. Try this: SELECT rd.id, COUNT(mb.id) FROM user_registration_details AS rd INNER JOIN user_mail_blist AS mb ON mb.user_id = rd.id AND mb.save_id = 1 WHERE rd.username = 'testaccount';
  3. Yeah. Do you have some sort of control panel you are managing your MySQL server with, or are you using the CLI console?
  4. They are used when something "exceptional" occurs, so to speak. E.g. if (!$item = $model->getById($_GET['id'])) { throw new DomainException('Item not found.'); } if (1 > $_GET['page'] || $_GET['page'] > $numPages) { throw new OutOfRangeException('Invalid page number.'); }
  5. You can use DirectoryIterator to scan the folder for items. You can use functions like readfile or file_get_contents to read them. You can use GD to manipulate the images. I suppose you'll have to be more specific to get more help.
  6. No, yours is better. samshel's will not complete the remainder of items in the loop if the first email is sent.
  7. What do you need to search for?
  8. Seems like the mysqli extension in PHP has been disabled. You might want to contact your host about that.
  9. Your username and/or password is wrong or that particular user is not allowed to login from the server where your script is.
  10. That link isn't even valid in SMF. Where did you get that link?
  11. Try to run the query directly on the db instead.
  12. There are other reasons why SMF would be difficult to dive into...
  13. Which particular script would that be?
  14. In web design it usually refers to the deprecated practice of having a 1x1px transparent gif and then using the height and width attributes on the img tag to push things downwards or to the side.
  15. The Little Guy... must be midget porn then.
  16. It doesn't look like you have a foreign key on gtown_eticket for gtown_event. If we say that you have a field in that table called events_id that links etickets to events then you can run a query like this: SELECT SUM( SELECT SUM(qty_ticket) FROM gtown_eticket AS t INNER JOIN gtown_events AS e ON t.events_id=e.events_id GROUP BY e.eticket_id ) AS tickets_sold FROM gtown_events WHERE events_id = 123; I haven't tested it, but I think it should work. It'll get you the amount of tickets sold for a particular event. Then you just have to check that it doesn't exceed the allowed amount using a simple conditional.
  17. Something that adds space between two elements. You could call it a separator as well.
  18. You obviously still need to actually execute the query and fetch the rows from the result like you did in your first code snippet.
  19. Yeah. Jeff did the layout, I did the programming.
  20. Right, just remove that entire line.
  21. Well, ok. You can just remove my else block.
  22. $sql = 'Select `Fname`,`Sname`, `Address1`, `Address2`, `Address3`, `Address4` FROM `Athy` WHERE '; if ($Fname && !$Sname) { $sql .= "`Fname` = '" . mysql_real_escape_string($Fname) . "'"; } else if (!$Fname && $Sname) { $sql .= "`Sname` = '" . mysql_real_escape_string($Sname) . "'"; } else if ($Fname && $Sname) { $sql .= "`Fname` = '" . mysql_real_escape_string($Fname) . "' OR `Sname` = '" . mysql_real_escape_string($Sname) . "'"; } else { throw Exception('Both first name and last name are empty.'); } You need to escape your values or bad things will happen.
  23. ip should be an unsigned integer (use MySQL functions INET_ATON() and INET_NTOA(), or PHP functions ip2long and long2ip). visit_date should be DATE or DATETIME. All of those TEXTs would be better off as VARCHARs. referrer should not be set to NOT NULL seeing as it might be the case that there is no referrer, in which case NULL would be the most appropriate value. Also, you'll not be able to track the referrer using that gif.
  24. robots.txt or perhaps nofollow.
×
×
  • 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.