Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. - The table columns (the text ones) need to be in utf8 format - The table itself and the database should also have it as the default encoding - You need to be connected to the database using utf8 encoding before any data is exchanged - Your code needs to treat all strings as multibyte strings - that means no strlen() or substr() (and others) and instead using the mbstring extension's equivalents - Your Content-Type response header and/or webpages need to mention the utf-8 encoding
  2. What does SHOW CREATE TABLE userdata say?
  3. Can you get the raw XML generated during the request? That'll make it easier to understand what's going wrong.
  4. That tutorial sucks. You need to find another one. Bad/outdated information, poor practices, SQL injection, XSS, deprecated extensions... a whole host of problems with it that are showing up in your code too. Did you happen to create your table using something like CHAR(16) for the password column?
  5. There's a lot of overlap though. "foo.jpg" is actually a valid domain name (which does not exist but that's not the point). So is "localhost". I'd say the determination between domain name and path should be done explicitly in code. For starters I wouldn't expect domains to be mixed up in routes - more like routes are added to configured domains. But with your current structure I'd think something like public function add_route($path, array $args, $domain = null) Router::add_route('/', array('controller' => 'shop', 'action' => 'items'), 'shop.bisi.bid');
  6. PHP 5.3 has been entirely unsupported for almost a year now. Even 5.4 is only receiving security fixes. Their inability to keep up with changing times is worrisome. PEAR's SOAP is not the same as the bundled version. For one, it doesn't have the SoapVar class which is why you're getting that fatal error. There is a SOAP_Value which sounds equivalent, but it's not identical. Maybe 'Item' => new SOAP_Value( 'Item', // name 'Service', // type array('ID'=>'1357') // value ),
  7. Sounds like $pwd is wrong. What's the rest of the code? Be sure to use tags when you post it.
  8. Not many people are familiar with SOAP. Are you sure SOAP is installed at all? And why are you using PEAR for it? And why are you still on PHP 5.3?
  9. "Valid domain" is broader than you probably realize, what with IP addresses and IDNs and such. How are you going to use this and how strict/precise does it need to be?
  10. No. There is no method named "attribute". Look at the documentation more closely. While I'm here, there are other problems with the code: - Either I'm blind or there is no "http://search.yahoo.com/mrss" namespace in the XML. - I doubt $media->attribute() (after it gets fixed) will return what you want because $media is a set of elements. - '$image' will be the literal value "$image". Variables don't work in single-quoted strings. Plus, it's an array so don't put it in a string to begin with.
  11. Why does it say "file" when the others say "file_array"? Two seconds.
  12. Don't use variable variables! An array is a perfectly adequate way of dealing with multiple values.
  13. The other common tactic is to construct a path relative to the web root: include $_SERVER['DOCUMENT_ROOT'] . '/food/admin/includes/admin-header.php';PS: You can use __DIR__ in place of dirname(__FILE__), but you'd still need a couple more dirnames() around it if you tried to use that method.
  14. Do an outer JOIN on the matching fields, then restrict the results to WHERE some non-nullable field IS NULL - which would only happen if the join failed. LEFT JOIN existing_table t2 ON t2.a = t1.a AND t2.b = t1.b AND... WHERE t2.some_non_nullable_column IS NULLOr you could just put a UNIQUE key on those columns, do an INSERT IGNORE, and let MySQL skip the duplicates for you. Which would be easier.
  15. You don't have to concatenate anything. Just search multiple columns. You can create an index on all the relevant columns to help with that... a rather large index, but would probably be worth it.
  16. You have to make a decision about what constitutes a duplicate record. One that is "already in the database", as you say. I'm guessing project+employee+expenditure+date? Maybe +hours? That information combined creates uniqueness and that's what you search for.
  17. Probably the glaring syntax error. You're also missing a colon.
  18. PHP's normal error output is very minimal. You have Xdebug installed - that's what's doing the orange and exclamation marks. Anyway, set display_errors=off and restart Apache.
  19. requinix

    Query Hangs

    What does EXPLAIN SELECT ORD_Item, ...output?
  20. That means the $page->post_title is an array (I think that's what's going on). So what's in the array? Use something like print_r() or var_dump() or even json_encode() to see, if you're not sure.
  21. Count your {s and }s and see which ones match up with which ones. Proper indentation will also make it much easier to read.
  22. ... How about sorting by the zone?
  23. 1. It looks like you're checking to see if the person exists, and if so, doing the insert. Got that backwards. 2. If this script executes twice at once, with the same person name, then one may both think the person doesn't exist and both try to insert the person. The name is the unique value, right? Make sure your table has a UNIQUE constraint on the name, then do an INSERT IGNORE without bothering to check if the person exists yet. If they do then the insert won't do anything, and if they don't then you've checked and inserted at the same time (which address problem #2).
  24. You'll have to figure out what is taking so long (infinite loop?) in PHP - what the browser says is irrelevant. Nothing in the code you've posted would be at fault so look elsewhere. Maybe AddToCart? The rest of the code you didn't post?
×
×
  • 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.