SQL query?? SQL query??
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

SQL query??

Started by cmfa, February 11, 2011, 03:55:13 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

cmfa

hi@all,

I am dealing with just another port from 1.4x. The plugin rcmenu has it done to me. Unfortunately I run aground at the time of a SQL query. I come here not keep it up right, so maybe someone has a tip why it jams.
The attached error message does not occur continuously. I suspect that my problem here begins with these lines.

.
.
.
//check posted value for Menu Item creation
$superCage = Inspekt::makeSuperCage();
$ci = $superCage->get->keyExists('create_item');
$c_i =$superCage->get->keyExists('change_items');
$c_l =$superCage->get->keyExists($p_id);
//addslashes

        if (isset($ci))
{
        $item_title = ($superCage->post->getEscaped('title'));
$item_admin = ($superCage->post->getEscaped('admin_menu'));
$item_hr = ($superCage->post->getEscaped('hr'));
$item_url = ($superCage->post->getEscaped('url'));
$item_target = ($superCage->post->getEscaped('target'));
        $item_id = ($superCage->post->keyExists('id')) +1;
        $sql = "INSERT INTO cpg15x_plugin_rcmenu (id,title,admin,url,target,hrnext) VALUES ('$item_id','$item_title','$item_admin','$item_url','$item_target','$item_hr')";
        cpg_db_query($sql);
}
.
.
.


the rest is running on 1.5xx, Does anyone have a tip for me

CMFA

Nibbler


$item_id = ($superCage->post->keyExists('id')) +1;


That looks like it should be


$item_id = ($superCage->post->getInt('id')) +1;

cmfa

hi

changed it with the same success. If I change here

if (($ci) !== TRUE)// no error, no entry
or
if (isset($ci)) // Error!

then the error message doesn't come but nothing is entered


CMFA

Αndré

I haven't looked at the plugin code, but it seems that you need to count up the ID plus one. So please use Nibbler's suggestion and try again. Maybe you also have to change all
->post->
to
->get->

cmfa

Hi,

   
I made the proposed amendment. Unfortunately without the desired success.
Do as above already described query if and do no page refresh the record is saved. F5 is the critical error.

CMFA

Αndré

Quote from: cmfa on February 11, 2011, 11:05:33 PM
Do as above already described query if and do no page refresh the record is saved. F5 is the critical error.
Sorry, but I don't know what you try to tell us.

cmfa

Hi@all

   
Problem found and fixed. Problem lay in the if condition

@ Andre thanks for the friendly kick ;)

VG

CMFA

Mimer

Is the problem solved in the attached file in the first post?
In other words, will you post the working plugin for cpg 1.5x?

Best regards
Mimer  8)

cmfa

Hi,

yes the problem is solved. Did the topic is not closed

vg

cmfa


Mimer

Great, tnx. Just what I needed.

Mimer  8)