Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Help in removing error

$
0
0
PHP Code:

<?php
        
//Post variables from step 1 and then check whether connect or not.
        
$host_post=$_POST['host-s1'];
        
$user_post=$_POST['user-s1'];
        
$pass_post=$_POST['pass-s1'];
        
$admin_post=$_POST['admin-s1'];
        
$apass_post=$_POST['apass-s1'];
        
        
//Checking mysql Connection if it corrects or not.
        
        
$conn=mysql_connect($host_post,$user_post,$pass_post);
        if(!
$conn){
        
$status=0;
        echo 
"Your connection details is not correct Check that";
        echo 
"<br>";
        echo 
"";
        }
        else {
        
$status=1;
        echo 
"Connection Established you can press continue.";
        }
        
?>
        <br>
        <br>
        <br><br>
        <br><br><br><br><br><br>
        <?php 
        
if($status==0){
        echo 
"Press back button";
        }
        else if(
$status==1){
        echo 
"<div style='float:right'>";
        echo 
"<form action='' method='post'>";
        echo 
"<input type='button' value='Continue' />";
        echo 
"</form></div>";
        }
?>


Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\website1\install\index2.php on line 67
Call Stack
# Time Memory Function Location
1 0.0008 148408 {main}( ) ..\index2.php:0
2 0.0100 156712 mysql_connect ( ) ..\index2.php:67

( ! ) Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\website1\install\index2.php on line 67
Call Stack
# Time Memory Function Location
1 0.0008 148408 {main}( ) ..\index2.php:0
2 0.0100 156712 mysql_connect ( ) ..\index2.php:67



I get this error i want if someone enter wrong user of database connection in the form it don't give error of mysql or php error just give me my error and that is either back button on error and next button on successful connection

Viewing all articles
Browse latest Browse all 13329

Trending Articles