1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Suggestion for PHP-mysql website-based quiz?

Discussion in 'PHP' started by rybrns, Mar 1, 2020.

  1. JEET

    JEET Notable Member

    Messages:
    3,368
    Likes Received:
    376
    Best Answers:
    16
    Trophy Points:
    235
    #21
    I am thinking the database user does not has enough permissions to create/alter/insert to database.
    SEMrush
    If it was an error in mysqli database connection, then you would not have been able to see scoring etc.

    For error reporting, check your PHP code files of this script, look for something like this:
    error_reporting( some values or numbers here );
     
    JEET, Mar 5, 2020 IP
    SEMrush
  2. JEET

    JEET Notable Member

    Messages:
    3,368
    Likes Received:
    376
    Best Answers:
    16
    Trophy Points:
    235
    #22
    Create a new database user in cpanel > MySQL databases

    Go back to "MySQL databases", and scroll down to the section where it says add user to database.
    Select this new user, select your database and proceed.
    On next page it will ask you to select permissions.
    Tick the "All privilidges" checkbox, and proceed.

    Then change the $user and $password values in this php script to match the database user and password of the user you just created.

    And run the script again.
     
    JEET, Mar 5, 2020 IP
  3. rybrns

    rybrns Active Member

    Messages:
    15
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    88
    #23
    My host provider doesn't appear to have that option. The php code all works, which displays the quizzes and does the scoring, but the mysql extensions, which save the info to the db, don't work at all.
     
    rybrns, Mar 6, 2020 IP
  4. rybrns

    rybrns Active Member

    Messages:
    15
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    88
    #24
    My provider doesn't have options like this (cpanel?) and I see nowhere to set permissions. The tool they provide for working with databases is phpmyadmin. I removed and re-created the db, entered the new access info, and ran the script again with the same result. No table created.
     
    rybrns, Mar 6, 2020 IP
  5. rybrns

    rybrns Active Member

    Messages:
    15
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    88
    #25
    Ok I found the reason the code won't work. My web host provider has disabled the CREATE TABLE command (and others for mysql) in php, an undocumented "feature" of their hosting package. The version of php 7 support they give has eliminated db manipulation by php unless you rent a dedicated server from them. Needless to say, I'm firing them. Any suggestions for a good shared hosting provider?
     
    rybrns, Mar 6, 2020 IP
    JEET likes this.
  6. JEET

    JEET Notable Member

    Messages:
    3,368
    Likes Received:
    376
    Best Answers:
    16
    Trophy Points:
    235
    #26
    A hosting provider that does not allows to create tables in database, that's new! All the crappy things these hosting providers do...

    I use hostgator shared hosting for some of my sites. works fine, support is also good, is not costly either.
     
    JEET, Mar 6, 2020 IP