SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 86
  1. #1
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP and MySQL database!

    I have been playing with Kevin Yank's MySQL database with member sign ups, and I can't get connected to the database!

    It gives me a pop-up error!

    It givse it when I try and log in, and when I try and sign up!

    Can you please help me?

    Thanks,
    ~someonewhois (AKA sowi)

    P.S. I hope this is the right forum!

  2. #2
    SitePoint Enthusiast tbag's Avatar
    Join Date
    Jan 2002
    Location
    ACT, Australia
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation well...

    Have you created the mySQL database or is it in the PHP script?
    - I am a PHP Guru
    - I am a Graphics Guru

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be helpful if you tell us what the error message is and post the portion of your code where you connect to the database. I am not familiar with the pop-up error message.

    Otherwise without knowing more information, the only suggestion I can give is to tighten your widgets and reboot your PC.


  4. #4
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know the error messege!

    It is a pop up that takes you back a step!

    I think it is the error from common.php!


    I might have fixed it, but the server is down temporarily!

    I need to know how exactly I would attempt to make a password reset, and a password change!

    I don't get how I would do that...

    Much help woulld be helpful!

    Thanks,
    ~someonewhois (AKA sowi)

  5. #5
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, the server is back up, and the following is the error:

    A database error occured in processing your submussion. If this error persists, please contact kevin@sitepoint.com.
    ANd then it takes me back to teh signup.php page!

    I don't know how to edit that messege, I can't find it anywheres!

    That is why it has kevin@sitepoint.com as the e-mail!

    Again, help neeed!

    Thanks,
    ~someonewhois

  6. #6
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I just found the error mesesge in signup.php!

    // Check for existing user with the new id
    $sql = "SELECT COUNT(*) FROM user WHERE userid = '$newid'";
    $result = mysql_query($sql);
    if (!$result) {
    error("A database error occurred in processing your ".
    "submission.\\nIf this error persists, please ".
    "contact kevin@sitepoint.com.");
    }
    if (mysql_result($result,0,0)>0) {
    error("A user already exists with your chosen userid.\\n".
    "Please try another.");
    That is the error messege, and I don't get it!

  7. #7
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    // Check for existing user with the new id 
    $sql "SELECT COUNT(*) FROM user WHERE userid = '$newid'"
    // add this line for debugging!
    echo "$sql <br />";
    $result mysql_query($sql); 
    if (!
    $result) {
     
    error("A database error occurred in processing your "
      
    "submission.\\nIf this error persists, please "
      
    "contact [email]kevin@sitepoint.com[/email]."); 

    if (
    mysql_result($result,0,0)>0) { 
      
    error("A user already exists with your chosen userid.\\n"
      
    "Please try another."); 

    As a guess, I am guessing that $newid is not being set. I assume it is comming from POSTed form data. See where I have added a line to the code above echo.... It is a good idea to echo out your SQL to the browser when debugging. That way you can see exactly how the query looks in its final form.

    If indead $newid is not being set, then we have to find where and why that is the case in your code.

  8. #8
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I figured it out with the help from Alex Cutts, known as AlexC here!

    Thanks Alex!

    It ended up being that I hadn't made the tables!


    OOPS!

  9. #9
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I have really no idea how to make the tables for MySQL!


    If you have MSN messenger and know MySQL, please post your ID here, and I'll add you!

    Thanks,
    ~someonewhois

  10. #10
    SitePoint Enthusiast tbag's Avatar
    Join Date
    Jan 2002
    Location
    ACT, Australia
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Heres a basic mySQL table

    Heres a basic mySQL code to create a table..

    PHP Code:
    $Query "CREATE table NewTable(id int
    PRIMARY KEY, information TEXT)"

    and that should help..
    - I am a PHP Guru
    - I am a Graphics Guru

  11. #11
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where do I put that?

    In a PHP script?

    Or in phpMyAdmin?


    Thanks,
    ~someonewhois

  12. #12
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm a moron when it comes to MySQL!

    I haven't used it ever...

    Just wiht Ikonboard, and Ikonboard makes the tables for you!

  13. #13
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, how would I make the tables?


    ID INT PRIMARY KEY AUTO_INCREMENT,
    userid VARCHAR(100) UNIQUE NOT NULL,
    password CHAR(16) NOT NULL,
    fullname VARCHAR(100) NOT NULL,
    email VARCHAR(100) NOT NULL,
    notes TEXT);";

  14. #14
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess this is more of MySQL now, but please still help!

  15. #15
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On the command line, in the mysql client program, you would type:

    CREATE TABLE YourTableName (
    ID INT PRIMARY KEY AUTO_INCREMENT,
    userid VARCHAR(100) UNIQUE NOT NULL,
    password CHAR(16) NOT NULL,
    fullname VARCHAR(100) NOT NULL,
    email VARCHAR(100) NOT NULL,
    notes TEXT);

    On what platform are your running mysql? Is it on your pc or on a remote server (linux?). If you are running on your PC, then one thing that may be of assistance is mysqlfront which is an application that gives a MS Access like GUI interface to mysql. I don't use it, but it came with the firepages bundle I downloaded from www.firepages.com.au The web site for mysqlfront is http://www.mysqlfront.de/

    Another utility that may be of assistance (especially if you are using a remote *nix server) is phpMySqlAdmin. It's a web page interface to MySQL.

    These are good tools to help you get started with MySQL.

  16. #16
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can make the tables in phpMyAdmin, if you got that installed...

    In phpmyadmin, you can select how many fields you want, and the type of fields.

  17. #17
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, I installed phpMyAdmin very easily, but I don't know how to make tables!

    I am not on my own computer, I am on a linux server, I think, that I am getting free hosting from a friend!

    Well, kind of a friend... AlexC's coasterwire, on donaldrflint's, coasterthrills section...


    Anyways, I really need some help with MySQL!

    Thanks,
    ~someonewhois


    P.S. Where is the command line?

  18. #18
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And another thing...

    What do I put for the number of fields?

    Thanks!

  19. #19
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I figured out that the fields are how many spots you want in the table..

    The following is what the table USER shows:

    Field Type Attributes Null Default Extra Action
    id int(11) No auto_increment Change Drop Primary Index Unique Fulltext
    userid varchar(100) No Change Drop Primary Index Unique Fulltext
    password varchar(16) No Change Drop Primary Index Unique Fulltext
    fullname varchar(100) No Change Drop Primary Index Unique Fulltext
    email varchar(100) No Change Drop Primary Index Unique Fulltext
    notes text No Change Drop Primary Index Unique Fulltext



    I hope that comes out properly...

  20. #20
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, that didn't work so well!

    Here comes an image!


  21. #21
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That image should help.... anyone else?

  22. #22
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry, but what is the question?

  23. #23
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't get it to work!

    It pops-up everytime I try and register!

    The tables are now set up (see the above picture) and it still doesn't work!


    Please help me either here, or by PM!

    I have MSN if anyone else does, just post your ID!

    Thanks,
    ~sowi

  24. #24
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anybody know hwo to do this?

    Did I do it right?

    WHATS WRONG?!


  25. #25
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure you have the followign information about your database:

    Your USERNAME
    Your PASSWORD
    Your DATABASE ADDRESS (probably localhost)
    YOUR DATABASE NAME (whichever individual database on the server you are using)

    The problem you are having almost certainly stems a connection error i.e PHP can't connect to your mySQL database for some reason.

    Also, what do you mean by a "pop up" error? Is it an error that appears in a pop up window or something else?


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
  •