Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá galera, fiz um site todo num servidor virtual (USB Server (É igual o XAMPP)) funcionou redondinho.
Mas quando eu foi botar no AR (Na internet mesmo / HOSPEDAGEM) ele deu um erro na hora de registar o cliente.
_____________________
No Database Selected
_____________________
Ele ta todo configurado para o servidor da hospedagem que paguei, so que aparece esse erro.
Segue o código abaixo.
index.php
<?php require_once('connections/config.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO academias (titulo, tag, imagem, `local`, telefone, link) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['titulo'], "text"),
GetSQLValueString($_POST['tag'], "text"),
GetSQLValueString($_POST['imagem'], "text"),
GetSQLValueString($_POST['local'], "text"),
GetSQLValueString($_POST['telefone'], "text"),
GetSQLValueString($_POST['link'], "text"));
mysql_select_db($database_registrar_anuncios, $registrar_anuncios);
$Result1 = mysql_query($insertSQL, $registrar_anuncios);
if($Result1){
echo ("<meta http-equiv='refresh' content='0, url=./system/sucesso.php'>");
}else{
echo("<meta http-equiv='refresh' content='0, url=./system/erro.php'>".mysql_error()."\n");
}
}
?>
_____________________________________________________________________________________________________________
config.php
<?php
$hostname_registrar_anuncios = "50.60.206.007:3306";
$database_registrar_anuncios = "guarapari-es";
$username_registrar_anuncios = "bot03";
$password_registrar_anuncios = "SENHA";
$registrar_anuncios = mysql_pconnect($hostname_registrar_anuncios, $username_registrar_anuncios, $password_registrar_anuncios) or trigger_error(mysql_error(),E_USER_ERROR);
?>Carregando comentários...