Welcome Guest, Not a member yet? Register   Sign In
How to check if the user has the right privilege to install db in php

[eluser]Wondering Coder[/eluser]
I know this might be the right forum to ask this but in the first place I've finished my first ever CI web app and now my adviser told me to create an installer. So here goes

First I want to show the mysql.user table that I query but unable to do this T_T. Then after this I will check if the particular user has enough privileges to create db and insert values. I have this code:

    if(!empty($user_name)) {
        $query = "SELECT * FROM mysql.user WHERE user='".$user_name."' AND host='".$server_name."'";
        $result = mysql_query($query);
        $row = mysql_fetch_array($result);

        echo $row['user'];

and this gives me an error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\dcs-pps\install\check_step3.php on line 34

Theme © iAndrew 2016 - Forum software by © MyBB