Jump to content

REMOVE WhiteSpace BEFORE Update


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...  :( :(

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>

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.