Jump to content

btherl

Staff Alumni
  • Posts

    3,893
  • Joined

  • Last visited

Everything posted by btherl

  1. Not quite, it checks that EVERY character is between 0 and 9. The ^ and $ anchor the start and end of the string, so the expression only matches if every character from the start to the end is 0-9. It also checks that there is at least one character (that's done by using + instead of * )
  2. hmm.. do you want the php source or the html source?
  3. You can send an email to the webmaster and ask for it. Do you own www.anothersite.com?
  4. btherl

    MysqlTarded.

    It sounds like a problem with your mysql configuration. Did you set a hostname, username and password for mysql in the game script?
  5. What goes wrong when you run your script?
  6. What does your current code do? What did you expect it to do?
  7. It should be like this: while ($row = mysql_fetch_array($rs)) { $arrProd[] = $row; //** this must be where things are going awry }
  8. Is every column identical for those rows? Keep in mind that null, empty string and 0 are all distinct values as far as union is concerned (though null is considered the same as null). And please reformat your query so it's readable
  9. The error is reported in config.php, not in the script you posted.
  10. Can you write a short script that replicates this behaviour? Or does it only occur in that particular situation? If you can, show us var_dump($TextBoxData), and tell us the exact version of php you are using.
  11. You can use normal files, sockets, pipes, tcp connections, shared memory. I would go for files for simplicity if possible. They are the easiest to deal with. For example, your background script can regularly write its progress to a specific file, and your front end can poll that file.
  12. I suspect the problem is processing order.. that is: 1. PHP executes 2. <(FirstName)> is replaced, AFTER php has finished 3. Page is displayed to user But really we need to know more about the API to help. How do you enable the api for your php script, or for your website?
  13. Can you post your code (with username and password replaced by ****)?
  14. What is the special API you are using? Is it invoked after php processing is completed?
  15. Oh, one more idea.. if that code is part of a larger script, keep in mind that the error may be elsewhere, not in the code you are staring at.. that's gotten me a few times
  16. I copied and pasted your script and it works fine here.. If you copy and paste it from the website here does it work for you?
  17. The table name is missing from that query. Is there somewhere where you should have configured a table name for mysql? For context, mysql organizes all data into "tables". For example, you might have one table for customers, one for orders, one for products, etc etc
  18. Here's an example: $var = 'foo'; function kitten() { global $var; print "var has value $var\n"; } Using $_GLOBALS will work the same way, except it's longer to type each time you use it Regarding all your functions, I'm not sure that's the best way to structure your code. What is the problem you are trying to solve (the programming task) ?
  19. Yes that will work. $var will be the array returned from function()
  20. Make sure you have no stray whitespace after the EOT (such as a tab). Heredoc syntax is quite fragile. Your syntax *looks* fine, which means there's something you can't see that is causing the problem. You might want to recreate the file from scratch if nothing else works.
  21. $_REQUEST is a single array, so that will work fine. Just make sure your functions expect an array as input. Yes, $_REQUEST is "superglobal", so you can access it anywhere. So no need to pass it around.
  22. Please show us your entire script, and the full class definition. If you want to show a small example, please make sure it demonstrates the problem you are seeing.
  23. In general, you're safest to list your joins out like this: SELECT * FROM t1 JOIN t2 ON (t1.field = t2.field) JOIN t3 ON (t2.field = t3.field) LEFT JOIN t4 ON (t3.field = t4.field) WHERE ... That makes it explicit how you are joining everything, and exactly where the left join should be done. The way you wrote your problem query, you were putting the condition for a different join inside the ON clause for your left join, which probably baffled mysql.
  24. I am unfamiliar with get_param() and to_sql(). Are those functions defined in your code somewhere? Or are they part of a library?
  25. I think your script is not being run as php. Check your browser configuration, or rename it to .php instead of .html
×
×
  • 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.