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 |
 |
 |
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 |
 |
 |
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 |
 |
 |
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 |
 |
 |
|