Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.