Can we call an variable and function directly when we include an file in php -




dbc.php

<?php  $con = mysqli_connect("****", "****", "****", "employees"); if(!$con) {   echo "connection error";   die(); }  ?> 

index.php

<?php require("dbc.php");  $query = mysqli_query($con, "select * uname"); //error : undefined $con if(!$query) {   echo "query error";   die(); } ?> 

how can call variables , functions when include file. why above declared $con showing error?





wiki

Comments

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

python - Minimize function with Scipy minimize -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -