No database selected Error plzz help expert mysql master

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    No database selected Error plzz help expert mysql master

    Code:
    <?php
    $conn = mysql_connect("localhost","star_zedge","password","true") or die(mysql_error());
    mysql_select_db("star_game",$conn);
    $sql = "SELECT * FROM 176x220";
    $result = mysql_query($sql,$conn) or die(mysql_error());
    while ($row = mysql_fetch_assoc($result)) {  
            echo"<br/>";
    	echo"Filename: {$row['filename']}";
            echo"<br/>";
    }
    ?>
    i got this error "No database selected"
    i have created star_game name database but when try to connect star_game database then i get this "No database selected" error but when i connect another database then work fine with this code.
    i think its phpmyadmin problem
    plzz expert masters any say solution of this problem

    #2
    watch the video tutorial on your server (if there is one) on setting up your database you will see where you have gone wrong :P

    Comment


      #3
      plzz help expert..

      Added after 2 minutes:

      i have craeted 7database and connect by using multiple databases.
      but i have problem in one database it now showing by sql quary.
      Last edited by arbind004; 18.04.12, 19:38.

      Comment


        #4
        is this off of the same server?
        icedroplets had a similar problem where he had to create a Main daatbase name and then assign the database names to the main one .... then change the local_host to the main database name.

        Comment


          #5
          Ok, thats problem solved,
          Problem in the cpanel phpmyadmin.
          i have changed cpanel now working fine.

          Comment


            #6
            Please tell me how you solved it

            Comment


              #7
              i guess u have error on your config username or password. .

              Comment


                #8
                Originally posted by arbind004 View Post
                Code:
                <?php
                $conn = mysql_connect("localhost","star_zedge","password","true") or die(mysql_error());
                mysql_select_db("star_game",$conn);
                $sql = "SELECT * FROM 176x220";
                $result = mysql_query($sql,$conn) or die(mysql_error());
                while ($row = mysql_fetch_assoc($result)) {  
                        echo"<br/>";
                	echo"Filename: {$row['filename']}";
                        echo"<br/>";
                }
                ?>
                i got this error "No database selected"
                i have created star_game name database but when try to connect star_game database then i get this "No database selected" error but when i connect another database then work fine with this code.
                i think its phpmyadmin problem
                plzz expert masters any say solution of this problem

                I think the one you are trying to connect the database does not exist.

                Comment

                Working...
                X