Jump to content

Having trouble with a Mysql query


swatmo

Recommended Posts

I admit I have no idea what im doing...

 

I need to increment a field in a Mysql table based on matching another field. Here is my code.

 

		$increment_count = 'UPDATE '.$this->tablename.' SET count = count + 1 Where confirmcode = '."$referid";  


	if(!mysql_query($increment_count , $this->connection))
	{
		echo 'TRIED AND FAILED AGAIN AND AGAIN';
	}

 

when I echo $increment_count i get:

UPDATE emailtab SET count = count + 1 Where confirmcode = 48032da2db11eff6a851f0c3279424fd

 

I am not sure what is wrong here. My other queries are working fine. Please help.

Link to comment
https://forums.phpfreaks.com/topic/240719-having-trouble-with-a-mysql-query/
Share on other sites

Nothing changes all the count fields just sit at 0 and do not increment. Every time i run it it makes the attempt and the gives the error statement.... I have no idea why this wont work. It is probably something really simple that I am overlooking... but its been like 3 hours on this issue, and im about to rip my eyes out of my ears.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.