note 83105 rejected from function.mysql-connect by felipe
| From: | felipe@php.net | Date: | Sat, 10 May 2008 14:26:27 +0000 |
| Subject: | note 83105 rejected from function.mysql-connect by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139238@lists.php.net to get a copy of this message | ||
Note Submitter: james at jr-production dot net
----
Im a new to sql and php so can any one help me to solve this problem. Im using dreamweaver cs3 to do
all the php code but its not working right Im getting this error message.
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in
/home/jrproduc/public_html/dommailinglist.php on line 39
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in
/home/jrproduc/public_html/dommailinglist.php on line 40
can anyone please help!!
<!--#include('/Connections/dommailinglist.php'); >
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue
= "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $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 users (email) VALUES (%s)",
GetSQLValueString($_POST['email'], "text"));
THE ERROR IS HERE---> mysql_select_db($database_dommailinglist, $dommailinglist);
$Result1 = mysql_query($insertSQL, $dommailinglist) or die(mysql_error());
} <---THE ERROR IS THERE
?>
If I take it out it goes through but it don't put it in the table.