Re: [PHP-DB] -- table name prefix in result set after join --

2002-11-23 Thread Marco Tabini
It really depends on the DBMS you are using, but you can use aliases as a trick to solve this problem: select a.col1 as a_col1, b.col1 as b_col1 from a join b on a.id=b.id This will return the two columns a_col1 and b_col1 Cheers, Marco -- php|architect - The magazine for PHP

[PHP-DB] Really dumb question... deleting everything but newest 100 rows?

2002-11-23 Thread Leif K-Brooks
I know this is a dumb question, but how would I delete everything but the first 100 results returned from a query? I know I'd use limit, but my mind's going blank as to the exact syntax. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will

Re: [PHP-DB] Really dumb question... deleting everything but newest100 rows?

2002-11-23 Thread Marco Tabini
If you have a column that gives you the newness of each row--I'm assuming a date here: delete from my_table order by date_inserted desc limit 100, -1 This should work... I recommend a db backup first :-) Marco php|architect - The magazine for PHP Professionals The monthly

Re: [PHP-DB] Really dumb question... deleting everything but newest100 rows?

2002-11-23 Thread Leif K-Brooks
I was thinking something along those lines, but phpmyadmin gives an error. The table currently has way too many rows (32362), could this have to do with it? Warning: Unable to jump to row 0 on MySQL result index 4 in /home/virtual/site1/fst/var/www/html/PhpMyAdmin/sql.php on line 223

[PHP-DB] Unserializing objects containing PHP code

2002-11-23 Thread Dave Smith
I am currently serializing some PHP objects and storing them in MySQL. When I pull them out of MySQL, I unserialize them and use them. Some of these objects contain PHP code inside of arrays. I'd like to execute that PHP code rather than display it. Any ideas how to accomplish this? (btw: I'd

[PHP-DB] Help In Colorado??

2002-11-23 Thread Chase
Is there anyone in the Denver / Aurora area that might be willing to help me out a bit?? I am working on a very small project that could lead to something much bigger, but I am not sure how to go about getting started. The big picture is that I want to sell various products on my website,