Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. AdaHacker

    magic quotes

    I wouldn't recommend that either. For one thing, it makes your code fragile, as a simple change in configuration can completely break everything. For another, magic quotes will be deprecated in PHP 5.3 and removed from PHP 6.0, so it would be better to future-proof your code by not relying on...
  2. AdaHacker

    select with joins

    Sounds like you want an outer join. Perhaps something like this: select c.firstname||' '||c.lastname, d.dept_name, s.salary_level, su.supervisor_name, from contact c LEFT JOIN dept d ON d.dept_id=c.dept_id LEFT JOIN salary s ON...
  3. AdaHacker

    Good IDE for PHP? (new news)

    Out priced? Komodo Edit is free! Granted, Komodo IDE is a little pricey, but if you don't need the extra features, there's no reason to shell out for it. I've been using the Linux version of Komodo Edit for over a year and it has everything I need.
  4. AdaHacker

    sed question?

    Good question. I actually never bothered to look that up until just now. It appears the reason is that, by default, sed uses Basic Regular Expressions (BRE), which do not include +, ?, and a few others. Those are only in Extended Regular Expressions (ERE). Thus sed treats them as normal...
  5. AdaHacker

    sed question?

    You're correct, but in this case sed thinks that you're using the + as a character to match, rather than to denote one or more occurrences. Try escaping that + and it should work. sed -i -e "s/^[ ]\+//" out.txt
  6. AdaHacker

    Recursive method find if object $this error

    Well, you're calling the method statically. That's what the double colon (::) means. If you want to use $this, you have to call it as an instance method, which means you have to instantiate an object of that class. So instead of your last line, do something like this: $tree_instance = new...
  7. AdaHacker

    'select as' and 'WHERE'

    Like ethorn10 said, you can't use a column alias in the WHERE clause. The reason for this is the order of execution in SQL. Bascially, the SELECT clause is executed after the FROM and WHERE, so the alias hasn't actually been set yet when the WHERE clause is executing. Joe Celko provides an...
  8. AdaHacker

    Select * as ?

    Why not dynamically generate the field list for the query? You could grab a list of the column names from the database, apply whatever transformations you need to turn them into a pretty "table.column_name AS Table_Column_Name" format, and dump that into the SELECT query that you pass to the...
  9. AdaHacker

    Problem with select statment

    Actually, this looks like half of it was copied out of MS Access. There are a couple of obvious problems here: 1) The IIf() function is a Microsoft thing - it doesn't exist in MySQL. The equivalent is just If(). 2) Your string concatenation is all messed up. Neither & nor + will concatenate...
  10. AdaHacker

    Views have changed to Tables? How can this happen?

    Just out of curiosity, where are you seeing the views listed as tables? Is this in the output of SHOW CREATE TABLE, the information schema tables, or the dump file? If you're seeing it in the backup produced by mysqldump, then that's normal. If you look closer, you'll see that the table is...
  11. AdaHacker

    embed a query in a query?

    Yes, you can do exactly that (though I think you wanted a WHERE instead of an AND in there): update table requests set listid = (select listid from lists where listname = 'blacklisted') WHERE requestid = 89; I'm assuming here that the sub-select will only ever return a single row. You can't...
  12. AdaHacker

    Remapping fields

    I was a little fuzzy on your description, but from the image, it looks like you're trying to do a cross tab kind of a thing. The good news is that it is possible to accomplish this sort of thing in SQL. The bad news is that there's no simple or obvious way to do it. The queries I've seen for...
  13. AdaHacker

    Using NoLock with table alias

    That would be because MySQL doesn't support a NoLock keyword. The reason it appears to work without the table alias is because MySQL lets you specify the table alias without the AS keyword. So the query "SELECT * FROM table1 NoLock" would make NoLock the alias for table1, but would not affect...
  14. AdaHacker

    appending "difference" between tables

    You're probably looking for something like this: SELECT oldbonus.vin, oldbonus.amount FROM oldbonus LEFT JOIN bonus ON oldbonus.vin = bonus.vin WHERE bonus.vin IS NULL; The results of the LEFT JOIN will have all the rows from oldbonus. If one of them does not have a corresponding row...
  15. AdaHacker

    Namespaces in php

    Yeah, apparently they haven't updated the documentation yet. The decision was made last weekend and hit Slashdot on Sunday. From what I've read so far, a lot of people seem...disappointed...by this choice.
  16. AdaHacker

    Namespaces in php

    If you just noticed that, you may also have missed that the namespace separator has changed from :: to \. So accessing a static class method through a namespace now looks like this namespace\subnamespace\class::method() And as an added bonus, not only is this syntax painfully ugly and...
  17. AdaHacker

    PHP File Upload (Windows Platform)

    As jpadie said, your $upload_path is certainly not correct. In addition to the possible issue with slashes, it looks like $upload_path is a directory. However, the move_uploaded_file() documentation says that the destination should be a full path (directory and file name). So if you already...
  18. AdaHacker

    sql script file comments

    Oh, wait, you're talking MySQL-specific. In that case, never mind, you're right. Sorry, guess I'm wasn't paying attention to which forum I'm in.
  19. AdaHacker

    sql script file comments

    Actually, that's not correct. No space is necessary - all you need is the 2 dashes. In fact, you can have pretty much any character you want after the double dashes, including more dashes. (Refer to page 83 of the ANSI SQL-92 standard.)
  20. AdaHacker

    Is this a configuration problem of konsole?

    Actually, you can specify window size and position when starting Konsole - or pretty much any KDE application, for that matter - from the command line. Just use the --geometry option. The argument to --geometry is a string of the form <width>x<height>+<x_pos>+<y_pos>. For example: konsole...

Part and Inventory Search

Back
Top