Error trying to host my website

Asked

Viewed 31 times

1

I’m with this mistake when I try to host my site, I’m using shaman

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\Nova pasta\htdocs\dashboard\bd.php:21 Stack trace: #0 C:\Nova pasta\htdocs\dashboard\home.php(3): include() #1 C:\Nova pasta\htdocs\dashboard\index.php(15): include_once('C:\\Nova pasta\\h...') #2 {main} thrown in C:\Nova pasta\htdocs\dashboard\bd.php on line 21```

Meu codigo 
```<?php



$hostname = 'localhost';                 



$user = 'root';                            



$pass = '';                             



$dbase = 'clientea_lojateste';                          



$db = mysql_connect($hostname,$user,$pass);



mysql_select_db($dbase);



?>







<?php



function runSQL($rsql) {



    $hostname = 'localhost';



    $username = 'root';



    $password = '';



    $dbname   = 'clientea_lojateste';



    $connect = mysql_connect($hostname,$username,$password) or die ("Error: could not connect to database");



    $db = mysql_select_db($dbname);



    $result = mysql_query($rsql) or die ('test'); 



    return $result;



    mysql_close($connect);



}



?>



<?php







$cadastr=mysql_query("SELECT * FROM admin");



$cadastro=mysql_fetch_assoc($cadastr);







$data_inicial = date('d/m/Y');



$data_final = $cadastro['data_expira'];







function geraTimestamp($data) {



$partes = explode('/', $data);



return mktime(0, 0, 0, $partes[1], $partes[0], $partes[2]);



}







$time_inicial = geraTimestamp($data_inicial);



$time_final = geraTimestamp($data_final);



$diferenca = $time_final - $time_inicial;



$dias = (int)floor( $diferenca / (60 * 60 * 24));







?>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.