Jump to content

REMOVE WhiteSpace BEFORE Update


Go to solution Solved by PriteshP23,

Recommended Posts

This query is not working.  I need urgent help. Thanks a lot in adv.

 

ROWS affected: 0

 

I have cross checked the data in the table for the given condition.

$sql = 'UPDATE LTE_noria_cellule cel_bk_up SET cel.NAP_'.$site->ur().' = \'1\' '.
			'WHERE cel.nidt 
			IN (
			    select gn 
				from LTE_noria_candidat_bk_up can 
			    INNER JOIN LTE_noria_site_bk_up site ON (site.codesite = can.codesite)
			    WHERE '.$site->get_param('zone_bde').')';

I believe problem is because of WHITESPACE.

 

 

When i search "codesite" in the table with "LIKE". I can't find it. But when i did "LIKE%" , it's working.

 

I tried this also but not working :(:confused:

$sql = 'UPDATE LTE_noria_cellule cel_bk_up SET cel.NAP_'.$site->ur().' = \'1\' '.
			'WHERE cel.nidt 
			IN (
			    select gn 
				from LTE_noria_candidat_bk_up can 
			    INNER JOIN LTE_noria_site_bk_up site ON trim(site.codesite) LIKE CONCAT('%',trim(can.codesite),'%')
			    WHERE '.$site->get_param('zone_bde').')'; 

:facewall:

Link to comment
https://forums.phpfreaks.com/topic/281428-remove-whitespace-before-update/
Share on other sites

You need the word "WHERE" in that query

 

Here it is:

TO<br>(x>220000 AND  x<910000 AND  y>1473000 AND  y<2460000)<br><br>UPDATE LTE_noria_cellule cel_bk_up SET cel.NAP_TO = '1' WHERE cel.nidt
                        IN (
                            select gn
                                from LTE_noria_candidat_bk_up can
                            INNER JOIN LTE_noria_site_bk_up site ON (site.codesite = can.codesite)
                            WHERE (x>220000 AND  x<910000 AND  y>1473000 AND  y<2460000))

Still NOT WORKING...  :( :(

  • Solution

GURU...!! You are right..!! :) :) :)

TO<br>(x>220000 AND  x<910000 AND  y>1473000 AND  y<2460000)<br><br>UPDATE LTE_noria_cellule_bk_up cel SET cel.NAP_TO = '1' WHERE cel.nidt
                        IN (
                            select gn
                                from LTE_noria_candidat_bk_up can
                            INNER JOIN LTE_noria_site_bk_up site ON (site.codesite = can.codesite)
                            WHERE (x>220000 AND  x<910000 AND  y>1473000 AND  y<2460000))TO<br>TO<br>
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.