Forum Moderators: coopster

Message Too Old, No Replies

mysql query stopped working.?

         

ajcether

6:36 pm on Jun 25, 2008 (gmt 0)

10+ Year Member



When I submit a form from my site, I want the information to be sent and stored in a database. This was working in the past, but now nothing is being inserted into the database when it should.

my code:

$sql = "INSERT INTO " . TABLE . " (name, email, comments, user_agent, remote_address, http_referer, resw, resh, colordepth, commenttype) ". " VALUES ('" . mysql_real_escape_string($this->name) . "', '" . $this->email . "', '" . mysql_real_escape_string($this->comments) . "', '" . $this->user_agent . "', '" . $this->remote_address . "', '" . $this->http_referer . "', '" . $this->resw . "', '" . $this->resh . "', '" . $this->colordepth . "', '" . $this->commenttype
. "')";

return mysql_query($sql);

I've made my page echo the $sql, so I know it's reaching this point and $sql is correct. I've tried putting the $sql info directly into the mysql_query...nothing.

Please help me figure this out,
Thanks!

eelixduppy

6:41 pm on Jun 25, 2008 (gmt 0)



Add the following:

return mysql_query($sql) or die(mysql_error());

See what error returns. Also, try running the query directly in your database from the command line.