Jump to content

ultrus

Members
  • Posts

    244
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.christopherstevens.cc

Profile Information

  • Gender
    Not Telling

ultrus's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I got it. Never mind. It's something like: SELECT p.first_name, p.last_name, (SELECT i.info_type FROM info i WHERE i.person_id = p.id ORDER BY i.sortby ASC LIMIT 0,1) AS c1_type, (SELECT i.info_type FROM info i WHERE i.person_id = p.id ORDER BY i.sortby ASC LIMIT 1,1) AS c2_type, FROM people p
  2. Hi, I have contact info stored in two tables. Each person in the people table has multiple pieces of contact info (phone number, email, etc.) in the info table. I can left join for multiple rows of fun (with repeating person details) like this: SELECT p.first_name, p.last_name, i.info_type, i.info_content FROM people p LEFT JOIN info i ON i.person_id = p.id resulting in something like this: Bobola, Fossmosto, E, bobola@somewebsite.com Bobola, Fossmosto, P, +1.111.111.1111 How would I alter my query to get something like this? first_name, last_name, c1_type, c1_content, c2_type, c2_content Bobola, Fossmosto, E, bobola@somewebsite.com, P, +1.111.111.1111 Thanks for pointers in advance.
  3. I may have found an answer here: http://stackoverflow.com/questions/9285143/mysql-you-cant-specify-target-table-a-for-update-in-from-clause
  4. Hello Gurus, I'm trying to delete rows from a table, but would need to join in some data from another table (that I don't want to delete from), use an embedded SELECT statement, or run multiple queries (don't want to do that last one). Query: DELETE FROM event_guest WHERE guest_id IN (SELECT eg.guest_id FROM event_guest eg LEFT JOIN guest g ON g.id = eg.guest_id WHERE g.attendee_id = '2') Error: #1093 - You can't specify target table 'event_guest' for update in FROM clause But this part works: (SELECT eg.guest_id FROM event_guest eg LEFT JOIN guest g ON g.id = eg.guest_id WHERE g.attendee_id = '2') Any thoughts on how to restructure this correctly? Thanks a ton in advance!!
  5. Ok, maybe your right. I put some good practice in and came up with the same results. Thanks for your help!
  6. There's other divs, but not other divs with the id of "admin-menu", and no other divs inside of that, just a giant unordered list with links. I'm getting close to a solution. Any other thoughts before I beat you to the solution?
  7. Now that I've let it out.... I'm using Dreamweaver, which can make use of regular expressions just like php, to clean up a ton of static archived pages. I want to select content between <div id="admin-menu"> and the next </div> that will be replaced with nothing in my find and replace box. I have to use regex because the content between those tags change from page to page, no other divs though in between so that might help. Any thoughts? This stuff makes my head hurt. Best regards, Chris EDIT: Here's a start, selects any div, contents, closing div (I'm fine if I select the div along with the content). Now I just need to add the ' id="admin-menu"' bit so that I don't select just any content... <div\b[^>]*>(.*?)</div>
  8. I was very close. I had to revise: RewriteCond %{REQUEST_URI} !^staging to: RewriteCond %{REQUEST_URI} !^/staging Life is now good. Thanks!
  9. Hello, I have an event site. At the moment last year's event links are being redirected from the current site to a 2011.mysite.com website (so the pages don't break and people can see what happened). example: mysite.com/agenda -> 2011.mysite.com/agenda If visiting the home page, people get redirected to a landing page on the current site like this: mysite.com -> mysite.com/event2012 Here's what's new. I want to NOT redirect people if they access anything in the new "staging" folder: mysite.com/staging/agenda = mysite.com/staging/agenda How do I do this while keeping everything else in tact? Here's my current .htaccess contents Options +FollowSymLinks RewriteEngine on RedirectMatch 301 ^/$ http://www.mysite.com/event2012/index.html RewriteRule ^$ event2012 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^index.htm RewriteRule ^(.*)$ http://2011.mysite.com/$1 [L,QSA] Thanks for the assist in advance! EDIT: I was going to replace RewriteCond %{REQUEST_URI} !^index.htm with RewriteCond %{REQUEST_URI} !^staging But that doesn't seem to make a difference. Any thoughts?
  10. I got it figured out: SDO Sun Image Moved From Black to Blue Background by ultrus, on Flickr Using clutImage() did wonders. Instead of a 3D Hald Clut image, I used a 2D Clut image to change black to dark blue and gradient after that. See this page for more info on how it all works: http://www.imagemagick.org/Usage/color_mods Best regards,
  11. So far I'm finding this to be interesting: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); $image = new Imagick('latest.jpg'); $clut = new Imagick('hald.png'); $image->clutImage($clut); $image->writeImage('test_out.jpg'); ?> <img src="test_out.jpg" alt="sun" /> Looks TERRIBLE!... but it does use a color lookup table to replace colors. I'm learning more about "hald" and "clut" now... http://www.imagemagick.org/Usage/color_mods/#hald_replacement EDIT: It looks like there's clutImage() and haldClutImage(). Sadly haldClutImage() is not supported on my server (docs say may be svn only). Looking into alternatives... [attachment deleted by admin]
  12. I'm not looking to use Photoshop's magic wand tool (I did that for the right image above for demo). I'm looking to use GD or ImageMagick to accomplish this using PHP. I'll be incorporating a live image of the sun into my design (doing this once per hour with Photoshop would kill me).
  13. Howdy, I have a live image of the sun from SDO (original on left) that I want to incorporate into a design dynamically. In order to do this I need to replace the black background with a blue one (see right image for general idea, created with Photoshop for demo purposes). If I do a simple color replace of black to blue, I get the middle image as a result naturally. This is rather rigid and ugly though, so I need something that will deal with multiple shades and keep as much of the orange/blue combo looking nice as possible. Do you know of a good way to do this using GD or ImageMagick (using Imagick)? So far ImageMagick seems more elegant. Thanks for the feedback in advance. Best regards, Chris
  14. Aha! I found the notes I needed there. Thanks! (why I didn't look there first, who knows)
  15. You know how on some servers, PHP content like a large dynamic table will show as the table is created, but other servers will keep a white pending screen until the whole page is ready and load it all at once? What's the ini or other setting that let's me choose? I'd personally like to show a page while it is being created but am not sure how to get started with that. Thanks for the feedback in advance.
×
×
  • 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.