Dear firnds,
I want to upload my php Forms and database...I am using godaddy.com i have my login and pwd.... I uploaded Survey project Php files and database.please,check my conn.php file code is below

<?php
$username="mydbphp@182.50.131.34";
$password="";
$server="166.62.8.51";
$db="mydbphp";

$conn=new mysqli($server,$username,$password,$db);
if(!$conn){

echo "Connection not established";
}


?>

please, suggest me..

Recommended Answers

All 9 Replies

I'm assuming you removed the password for this post and it is being included in the actual config.
The only advice I can give is to double check what you should be passing in. In particular the db name and server. Are you sure it shouldn't be localhost or include a port number?

i put db name the name which is online Mysqladmin database name.that is mydbphp and online server is 166.62.8.51 ,

Server version: 5.5.37-35.0-log
Server: 166.62.8.51 via TCP/IP
User: mydbphp@182.50.131.34

error is when i online tthe page:
"Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied for user 'mydbphp@182.50.131.34'@'182.50.130.77' (using password: YES) in /home/content/62/10830362/html/test/conn.php on line 7"
yes i put my password there.

Access denied for user at least means you are connecting to the server. You're getting denied due to either the user name or the password. Have you tried just
$username="mydbphp";

Drop the host part. That might help. Although you create a user in mysql specifying the host it normally isn't part of the login user name.

Try changing your host to localhost or 127.0.0.1

yes it works... i put username=mydbphp..

Dear gabrielcastillo !
i am not on local host i want to put my application online....

dear friend,

reveive data from previous form but when i want to insert email in "atab"
it shows only "error".
please, guide me ....

please, check this code below,

        <?php
            include "conn1.php";

               if(isset($_GET['submit']) && isset($_GET['q'])){

               $answer=$_GET['q'];
               $hid=$_GET['hid'];
               $mail=$_GET['email'];

               $sqlu="UPDATE atab
               SET
               email=$mail
               $answer=$answer+1
                WHERE Qid=$hid";
               $result=$conn->query($sqlu);
               if ($result){
                   echo("user has voted");}
               else {
                 echo("Error") ;
               }

                }

            ?>



    in 

        $mail=$_GET['email'];

it shows only "error".email can not be inserted in atab.
please, guide me ....

I checked only Numarical data can be updated but charecter can not Updated
what is problem there?

hello anybody can help meee. plzzzzzzzzzzzzzzz

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.