AdaHacker's Profile User Rating: -----

Reputation: 453 Architect
Group:
Active Members
Active Posts:
812 (0.33 per day)
Joined:
17-June 08
Profile Views:
13,842
Last Active:
User is offline Feb 18 2015 02:02 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
Opera
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   AdaHacker has not set their status

Posts I've Made

  1. In Topic: Character encodig mystery

    Posted 8 Feb 2015

    That's the thing about Unicode - just because two glyphs look the same doesn't mean they represent the same codepoints.

    It looks to me like that's exactly what you have - two completely different character strings that just happen to render as the same glyph. In the first case (var a in your example), you actually have a two-character string - a plain-old lower-case "e" (codepoint U+0065) followed by a "combining acute accent" (U+0301). You can see that in the JSFidle by doing a.charCodeAt(1), which returns 769 or 0x301. This just happens to look the same as the second case (var b above), which is actually a single "lower case e with acute" character (U+00E9).

    The iconv conversion fails because the stand-alone "combining acute" character doesn't exist in the Mac Roman character set. The easiest way to deal with that is to pass the //IGNORE flag to iconv so that it will just strip any characters that it can't convert, e.g. iconv("utf-8", "macintosh//IGNORE", $s). In some cases, the //TRANSLIT flag can also be useful for converting unsupported characters into "something close", but that actually doesn't work in this case.
  2. In Topic: PDO insert record issues

    Posted 24 Sep 2013

    View Postmutago234, on 24 September 2013 - 12:56 PM, said:

    it seems that NOW() belongs in sql statements not in the array.

    Yeah, that's basically it. The execute() call is used to bind values to the query - you can't pass it fragments of SQL. So you'd either need to change your query to INSERT INTO tb (session_id,timing) values (:session_id,NOW()) or just calculate the value in PHP. Or, as modi123_1 suggested, you could just set a default on the "timing" column and not specify a value at all.
  3. In Topic: Sessions mysql deprecated to PDO conversion queries issues

    Posted 24 Sep 2013

    Well, the error pretty much says it all - $db is not defined. You created it you "database handler" but you never bring it into scope in your class methods. You would need to reference it with a global $db declaration in each method to make that code work.

    Of course, using global variables isn't such a great practice in the first place (maybe use a singleton or something instead), but that's a different issue.
  4. In Topic: Can't find the file on server glitch

    Posted 21 Aug 2013

    Just look at like 35 of your view_files.php:
    <td align=\"left\"><a href=\"download_file.php?uid=<?php{$row['upload_id']};?>\">{$row['file_name']}</a></td>
    

    Your uid parameter in the URL is messed up - you're including php tags when doing string interpolation. That means $_GET['uid'] is going to come through as <?php12345;?>, which will always get converted to zero when you cast it to an integer.
  5. In Topic: Select ID twice from a table in SQL

    Posted 21 Aug 2013

    View Postsquibby, on 20 August 2013 - 09:50 PM, said:

    I want the following output.

    SENT BY / MESSAGE / SENT TO / SENT DATE

    A UNION is not going to get you that format. Using a UNION will just lump together the results of two queries with the same result format into a single table. Something like your sample query would just give you a 3-column table with conflicting entries rather than the 4-column format you want.

    The easiest method would be to just join on your users table twice using two different aliases. That will allow you to independently match different user rows against different columns. For example, something like this should work:
    SELECT u1.user_real_name AS sentby, email_staff_log_message, u2.user_real_name AS sentto, email_staff_log_date_sent
    FROM email_staff_log, users AS u1, users AS u2
    WHERE email_staff_log.userid = u1.user_id AND email_staff_log.email_staff_log_sent_to = u2.user_id
    
    

My Information

Member Title:
Resident Curmudgeon
Age:
37 years old
Birthday:
August 16, 1977
Gender:
Location:
Brockport, NY
Interests:
On the technical front, I'm interested in software design methods, formal modeling, database theory, etc.. In more general terms, I like to play the piano, study philosophy, and work in my garden.
Years Programming:
14
Programming Languages:
PHP, Python, VB.NET/6, C#, SQL, ActionScript (mostly FLEX), and whatever other stuff I've worked with that I feel like including today.

Contact Information

E-mail:
Private
Website URL:
Website URL  http://linlog.skepticats.com

Friends

Comments

Page 1 of 1
  1. Photo

    AdaHacker Icon

    09 Feb 2011 - 15:18
    <shrug> Never really had anything to ask. I prefer to just take a quick browse through my favorite forums once in a while and provide a few quick answers. Less of a time commitment.
  2. Photo

    modi123_1 Icon

    09 Feb 2011 - 13:39
    Odd.. you are a member since Jun 2008, have 572 active topics, but have zero posts originated by you. Quirky.
Page 1 of 1