1

my code on localhost running correctly but when i am putting code on go daddy server its keep showing this error what is problem i don't know here is database connection code

<?php

$hostname="148.72.232.172";
$username="iam4raj";
$password="*******";
$dbname="iam4raj_";
    $con=mysqli_connect($hostname,$username, $password,$dbname);

when i am running this code individually its running and when i am using this $con variable in other code i am getting that error,why here is code where i am getting error

  <?php
                $c_query="select  * from  goverment ";
                $c_run=mysqli_query($con,$c_query);
                if(mysqli_num_rows($c_run)>0)
                {
                    while($row=mysqli_fetch_array($c_run))
                    {
                        $id=$row['id'];
                        $cat=$row['category'];

                ?>

someone help me please .Here is error

PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given
PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given

Dharman
  • 30,962
  • 25
  • 85
  • 135
Raj
  • 151
  • 1
  • 11

0 Answers0