Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Needing help to get data from mysql

    I'm trying my php and mysql skills with simple membership system website.
    But now I'm confused how to get data from mysql.

    I have follow table in myqsl:

    CREATE TABLE `users` (
    `id` bigint(20) NOT NULL,
    `username` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `avatar` text NOT NULL,
    `signup_date` int(10) NOT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

    And I managed to make follow code to get user's "id".

    <?php echo "<title>{$_GET['id']}</title>"?>

    but when I'm changing 'id' to username I get error.

    Notice: Undefined index: username in C:\Users\User\Desktop\EasyPHP\www\profile.php on line 13


    I'm thankful if you can just point me forward what to do next.

    SOLVED BY MY OWN
    Last edited by Maicii; 12-23-2012 at 04:19 PM.

  • #2
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Depending on the application your output to the browser would change but to output a value to the browser would be by echoing a value like:

    echoing $row['row_name']

    Insight to your learing project. I applaud your efforts in learing php/MySQL coding. I myself am a novice coder that is knowledgeable in some areas and completely oblivious in other areas...

    When in doubt ask. Just a helpful hint that I learned over time, be as descriptive as possible when trying to get help on an issue. As it will make for a quicker result..

    Good luck and welcome to the forum.
    Last edited by Ctechinfo; 12-24-2012 at 05:10 AM.


  •  

    Posting Permissions

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