note 83105 added to function.mysql-connect

From: Date: Sat, 10 May 2008 03:13:00 +0000
Subject: note 83105 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-139231@lists.php.net to get a copy of this message
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. ---- Server IP: 217.174.223.124 Probable Submitter: 24.136.159.113 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- https://master.php.net/note/edit/83105 Del: integrated -- https://master.php.net/note/delete/83105/integrated Del: useless -- https://master.php.net/note/delete/83105/useless Del: bad code -- https://master.php.net/note/delete/83105/bad+code Del: spam -- https://master.php.net/note/delete/83105/spam Del: non-english -- https://master.php.net/note/delete/83105/non-english Del: in docs -- https://master.php.net/note/delete/83105/in+docs Del: other reasons-- https://master.php.net/note/delete/83105 Reject -- https://master.php.net/note/reject/83105 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139231) next »