Jump to content

Mysql Error


neohunter

Recommended Posts

Hi, i have this function:

function DescFileToSql(){
$miconexion = new DB_mysql;
$miconexion->conectar("unionro_intranet", "localhost", "root", "mypassword");
foreach($this->loadFile('idnum2itemdesctable.txt') as $key => $value){
$value = str_replace("'","\'",$value);
$querry="UPDATE `item_db` SET `desc` = '".$value."' WHERE item_db.id = $key;";
$miconexion->consulta($querry);
$miconexion->verconsulta();
if($miconexion->Error){
echo "<b>$key:</b>:<br>";
echo $querry;
echo "<font color=#ff0000>".$miconexion->Error."</font>";
echo "<br>";
}
}
}

and give me this error:

UPDATE `item_db` SET `desc` = 'A tame for the monster: Argos -=- Happy Catching Item Class : ^777777Pet Tame^000000 Weight : ^77777720^000000 ' WHERE item_db.id = 9606;

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 '' at line 1

but i execute the querry that gives me on phpmyadmin and works. what happend?

Link to comment
https://forums.phpfreaks.com/topic/28642-mysql-error/
Share on other sites

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.