SOLVED - Form data not posting to mysql

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

thx967
Forum Newbie
Posts: 20
Joined: Thu Feb 24, 2005 3:14 pm

Post by thx967 »

smpdawg wrote:Actually it never occurred to me that you were changing the code at the top. Some people will not know that is what you did and may end up saying something about the code looking right because they don't know that you changed it but I know where you are coming from.

You may want to add that or die() to DbConnector.php so you can see the error message. You can always remove it when the code is stable.
How would I add that to my function query without rewriting the bulk of my code? I've tried adding it at the end of my current query - and it dies alright. none of my queries work with the revised statement.

Code: Select all

//*** Function: query, Purpose: Execute a database query ***
function query($query) {
	$this->theQuery = $query;
	return mysql_query($query, $this->link) or die(mysql_error());
}
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

How about like this? Whether that works or not, what does the current $insertQuery look like? I am on IM (MSN, AIM and ICQ) right now - I can walk through the code with you on IM if you'd like.

Code: Select all

//*** Function: query, Purpose: Execute a database query ***
function query($query) {
   $this->theQuery = $query;
   return mysql_query($query, $this->link) or die(mysql_error($this->link));
}
thx967
Forum Newbie
Posts: 20
Joined: Thu Feb 24, 2005 3:14 pm

PROBLEM SOLVED

Post by thx967 »

Thanks to smpdawg!!!

The problem was in my naming convention for one of the fields.

"desc"

It turn out that the name of the table field is restricted by mysql. changing the name to "desription" fixed my posting problem.
Post Reply