InNeedofHelp
06-16-2006, 03:00 PM
Hey DD,
I have a problem inserting information from a post into my MySQL database. I don't really know what the problem is or how to fix it, so i'm hoping one of you guys can help me. Here's the code:
function showMessages() {
if (!empty($_REQUEST['message']) and !$_REQUEST['message']=="") {
$chatText = $_REQUEST['message'];
$chatName = $_REQUEST['username'];
mysql_query("insert into Chat VALUES (0, '$chatText', '$chatName')",$con) or die('Problem sending message: ' . mysql_error());
echo $_REQUEST['message'];
}
}
I've located the problem somewhere in that function, but I don't know what the problem is. The error message i recieve when this function is called is this:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in c:\web\htdocs\chatroom.php on line 98
Problem sending message:
Anyway, I really need help on this one, so if anyone can help, I would greatly appreciate it.
Thanks.
I have a problem inserting information from a post into my MySQL database. I don't really know what the problem is or how to fix it, so i'm hoping one of you guys can help me. Here's the code:
function showMessages() {
if (!empty($_REQUEST['message']) and !$_REQUEST['message']=="") {
$chatText = $_REQUEST['message'];
$chatName = $_REQUEST['username'];
mysql_query("insert into Chat VALUES (0, '$chatText', '$chatName')",$con) or die('Problem sending message: ' . mysql_error());
echo $_REQUEST['message'];
}
}
I've located the problem somewhere in that function, but I don't know what the problem is. The error message i recieve when this function is called is this:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in c:\web\htdocs\chatroom.php on line 98
Problem sending message:
Anyway, I really need help on this one, so if anyone can help, I would greatly appreciate it.
Thanks.