SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    url decode from database

    i have a database which has some messages stored in urlencoded format

    i have the following for a dropdown

    PHP Code:
    $sql "SELECT * FROM logs WHERE id = ".$id."";
        foreach (
    $db->query($sql) as $row)
            {
            echo (
    '<option value="'.$row['txtid'].'">'.$row['message'].'</option>');
            } 
    how would i just urldecode the message row?

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,057
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Put $row['message'] inside urldecode()...

    PHP Code:
     echo ('<option value="'.$row['txtid'].'">'.urldecode($row['message']).'</option>'); 
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  3. #3
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    once again thank you very much for your help!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •