MySQL Forums
Forum List  »  PHP

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/jrproduc/public_html/dommailinglist.php on line 39
Posted by: James Holmes
Date: May 09, 2008 09:13PM

My code keep given me this 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.

Options: ReplyQuote


Subject
Written By
Posted
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/jrproduc/public_html/dommailinglist.php on line 39
May 09, 2008 09:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.