Skip to content

having an issue, I'm not getting inserts into the table #5

Open
coredatarecovery opened this Issue Aug 23, 2011 · 5 comments

3 participants

@coredatarecovery

The database is not getting updated, any suggestions for debug?
I'm running on qrtrk.us for my shortener, I'm getting qrtrk.us/0 for every shortened url and it's not forwarding
no lines have been inserted into the table shortenedurls

I've double checked the user name, the password, the database name
I can phpadmin and manually add lines/records but no redirect happens.

@ryanluce

I Don't think this works if the row count is less than the string length of ALLOWED_CHARS... kind of weird, don't know how this wasn't an issue when he built it. In the getShortenedURLFromID function if you insert $integer+=100 it works for me. Strange.

@dougwo
dougwo commented Nov 16, 2011

I have the same issue. I tried $integer+=100 at the beginning of the function and I still can't get inserts.

@ryanluce

here's the code I had modified awhile back:

function getShortenedURLFromID ($integer, $base = ALLOWED_CHARS)
{
    $integer += 100;
    $length = strlen($base);
    $out = "";
    
    while($integer > $length - 1)
    {
        $out = $base[fmod($integer, $length)] . $out;
        $integer = floor( $integer / $length );
        print "while loop: " . $out . " - ". $integer . "\n";
    }
    print "getshortened url:" . $out . ' ' . $base;
    return $base[$integer] . $out;
}

This was in shorten.php

@dougwo
dougwo commented Nov 16, 2011

I got mine working Ryan, but I am confused. This doesn't seem to be a shortener at all. It only stores an index. What is the point of $base of there isn't even a column in the database for a shortened slug?

@ryanluce

Yeah, I think it's fundamentally flawed. I used it for a brief time and then I believe I just implemented my own method. I can't speak for what the original author intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.