MySQL Forums
Forum List  »  PHP

Re: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource
Posted by: James Holmes
Date: May 11, 2008 10:13PM

Ok now I change some things it is giving me this error message now...

Warning: Wrong parameter count for mysql_query()

What does this mean?? Here is my code so you can take a look at.

<?php include('http://jr-production.net/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;
}
}

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"));

mysql_connect (LOCALHOST, jrproduc_dom, asia24);
$Result1 = mysql_query($insertSQL, $dommailinglist, true) or die(mysql_error());
$conn = mysql_connect(LOCALHOST, jrproduc_dom, asia24) or die( msql_error() );
}

?>

Its telling me that my error is at this line

$Result1 = mysql_query($insertSQL, $dommailinglist, true) or die(mysql_error());

If I take this out it runs like it suppost to but it just dont put the data into my dbase.. That website you gave me isn't helping so can you HELPPPPP PLEASE!!

Thanks,

James

Options: ReplyQuote


Subject
Written By
Posted
Re: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource
May 11, 2008 10: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.