CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 where am I mistaking? syntax question

Print topic Send  topic

Author Message
computerman


Posts: 27
Posted: 02/24/2010, 4:31 AM

my problem is to add '../store/images/' path to pictures.

this doesn't work:
$sql2 = "insert into product (model, image, price ) values(  " . $db2->ToSQL($db->f("product_code"),ccsText) .", '../store/images/". $db2->ToSQL($db->f("product_pic1"), ccsText) .", " . $db2->ToSQL($db->f("product_price"), ccsText) .")";  

this does work but it also places ' symbol in data:

$sql2 = "insert into product (model, image, price ) values(  " . $db2->ToSQL($db->f("product_code"),ccsText) .", '../store/images/' ". $db2->ToSQL($db->f("product_pic1"), ccsText) .", " . $db2->ToSQL($db->f("product_price"), ccsText) .")";  


thanks in advance.

_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying
View profile  Send private message
Gena

Posts: 591
Posted: 02/24/2010, 4:52 AM

$sql2 = "insert into product (model, image, price ) values(  " . $db2->ToSQL($db->f("product_code"),ccsText) .",  
'../store/images/". $db2->ToSQL($db->f("product_pic1"), ccsText) ."', " . $db2->ToSQL($db->f("product_price"), ccsText)  
.")";  

_________________
Gena
View profile  Send private message
computerman


Posts: 27
Posted: 02/24/2010, 5:20 AM

Quote Gena:
$sql2 = "insert into product (model, image, price ) values(  " . $db2->ToSQL($db->f("product_code"),ccsText) .",  
'../store/images/". $db2->ToSQL($db->f("product_pic1"), ccsText) ."', " . $db2->ToSQL($db->f("product_price"), ccsText)  
.")";  

thank you for help but this time I am having:

"../store/images/NULL" in my data field. :-<
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying
View profile  Send private message
Gena

Posts: 591
Posted: 02/24/2010, 5:37 AM

just check it!

add code after your $sql2=.. like

echo $sql2;

so you will see what is generated, check syntax, you can even copy generated statement and paste it into your DB manager and run here, you will see your error...

_________________
Gena
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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