Bom dia galera estou com um problema e sou iniciante em php e preciso da ajuda estou com o seguinte erro ao inserir os dados :
=========================================================================================================
Warning: mysql_select_db() expects parameter 2 to be resource, string given in /home/u522807324/public_html/HomeIpedApae.php on line 56
Warning: mysql_query() expects parameter 2 to be resource, null given in /home/u522807324/public_html/HomeIpedApae.php on line 57
=========================================================================================================
segue abaixo o meu codigo fonte :
///////////////////////////////////////////////////////////////////////////////////////////////////////
<?php require_once('Connections/ipedapae.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 iped (nome, cpf, datanascimento, endereco, complemento, bairro, cep, telefonemovel, telefonerecado, email, cidade, uf, profissao, localtrabalho) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nome'], "text"),
GetSQLValueString($_POST['cpf'], "text"),
GetSQLValueString($_POST['datanascimento'], "date"),
GetSQLValueString($_POST['endereco'], "text"),
GetSQLValueString($_POST['complemento'], "text"),
GetSQLValueString($_POST['bairro'], "text"),
GetSQLValueString($_POST['cep'], "int"),
GetSQLValueString($_POST['telefonemovel'], "text"),
GetSQLValueString($_POST['telefonerecado'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['cidade'], "text"),
GetSQLValueString($_POST['uf'], "text"),
GetSQLValueString($_POST['profissao'], "text"),
GetSQLValueString($_POST['localtrabalho'], "text"));
$base= mysql_select_db($database_ipedapae,"ipedapae");
$Result1 = mysql_query($insertSQL, $base) or die(mysql_error());
echo '';
$insertGoTo = "HomeIpedApae.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
/////////////////////////////////////////////////////////////////////////////////////////////////
ta ai meu codigo quem puder me ajudar por favor preciso muito de rodar esse codigo .