I'm hosting my php file in WAMPSERVER PHP Version 5.4.3 and my database is somewhere in the uni server
I keep getting this error and I don't know why
* A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond. in C:\wamp\www\test3.php on line 4*
However I also tried to host the php file in the uni server with PHP Version 5.4.11
and I get this error when I use mysql_connect or my mysqli_connect
Call to undefined function mysqli_connect() *
*Call to undefined function mysql_connect()
I'm so frustrated I don't know what else to do I think I've tried everything but it not working for me please help
this is my code
<?php
//Create the connection
$con = mysqli_connect("xxx","student","student4","student4DataBase") or die("Some error occurred during connection " );
//. mysqli_error($con));
// Write query
$strSQL = "SELECT SID FROM TABLE_STUDENT";
// Execute the query.
$query = mysqli_query($con, $strSQL);
while($result = mysqli_fetch_array($query))
{
echo $result["SID"]."
";
}
// Close the connection
mysqli_close($con);
?>