CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [solved] Error in CCS

Print topic Send  topic

Author Message
stefan_weiss

Posts: 4
Posted: 05/04/2010, 12:55 AM

Hi,

im currently using CCS 4.2.00.040, PHP5, MySQL5

I have created a small Project. At first i wanted to use MySQL Fulltext Search, but in this case it is not the right solution. No i've made a Grid and a Searchform.

In the Before Execute Select i inserted this code:
  
global $hmdbSearch;  
  
$tmpvar = $hmdbSearch->s_name->GetValue();  
  
if(strlen($tmpvar)){  
	$hmdb->DataSource->SQL="  
	SELECT * FROM hmdb   
	WHERE   
	name LIKE '%".$tmpvar."%'   
	OR format LIKE '%".$tmpvar."%'   
	OR title LIKE '%".$tmpvar."%'   
	OR keywords LIKE '%".$tmpvar."%'   
	OR description LIKE '%".$tmpvar."%'    
	";  
	echo $hmdb->DataSource->SQL;  
}  

the generated SQL lokks like this:

SELECT * FROM hmdb WHERE name LIKE '%pal%' OR format LIKE '%pal%' OR title LIKE '%pal%' OR keywords LIKE '%pal%' OR description LIKE '%pal%' 

The generated CCS php code returns this error:

Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE name like '%pal%' LIMIT 0,20' at line 8

I tried to use this generated SQL in phpMyAdmin - ist works without any error. I tried it in a very small php-script - ist works without any error.

Whats wrong?

Regards

Stefan
View profile  Send private message
stefan_weiss

Posts: 4
Posted: 05/04/2010, 1:25 AM

Tried the same with 4.3.00.7676 same problem
View profile  Send private message
stefan_weiss

Posts: 4
Posted: 05/04/2010, 4:24 AM

Sorry,

problem is solved. Solved with:

Dynamically Modify the WHERE Clause

Bye

Stefan
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 05/04/2010, 9:00 PM

stefan_weiss
Please put [Solved] or [Resolved] in the thread title. You might also want to change the title to SQL/Database error. Thanks.
View profile  Send private message
stefan_weiss

Posts: 4
Posted: 05/04/2010, 11:41 PM

The solution was to modify the Where in the Before Build select
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.