Jump to content

Refuse To Execute Valid Sql


MagicFire

Recommended Posts

Hi,

 

I have a problem. My PS 1.5.2 refuses to execute valid SQL statement. I don't know why.

 

The code is:

Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'slider` (`id_slider_image`,`name`, `position`) VALUES (NULL,"'.$name.'", '.$position.')');

 

which leads to result

 

INSERT INTO `ps_slider` (`id_slider_image`,`name`, `position`) VALUES (NULL,"Filter_bg.png", 1)

 

which is absolutely correct. If I take this result and copy it to the phpmyadmin SQL console, it works. So could anybody please tell me, where could be the problem?

 

I found out, that even a pure php functions isn't working too. But selecting is ok. Could be some permission problem? It's my own plugin. But if I can do select sqls why not the insert ones?

 

If I do this:

 

   $sql = "INSERT INTO `"._DB_PREFIX_."slider` (`id_slider_image`,`name`, `position`) VALUES (NULL,'".$name."', ".$position.")";   
   $result = mysql_query($con,$sql)
  or die("Bad query: " . mysql_error());

 

it exists with this:

 

Bad query:

 

Where could be problem?

 

Thanks

Edited by MagicFire (see edit history)
Link to comment
Share on other sites

No, it won't work. It simply doesn't insert anything. And this problem is focusing only to my plugin. Others working well. So I guess there must be something with permission (or anything like that). Because it doesn't throw any error message, even with all debuging on.

Strange is, that when I try to force him to do this function,it leaves the blank page (but no error, nothing, just blank page).

 

I've never has any experience with behavior like this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...