Welcome Guest, Not a member yet? Register   Sign In
Database driver barfs out a warning on num_rows
#1

[eluser]LeonardoGaiero[/eluser]
Greetings. I am having a bit of a problem I was hoping I could get help with: I'm developing an application, with a file upload function. The uploading part is managed by the application, while the referencing of the file on the DB is handled with a stored procedure.

However, I am getting a MySQL warning in my logs whenever I try to execute this function:

Code:
ERROR - 2010-12-05 14:42:44 --> Severity: Warning  --> mysql_num_rows(): supplied argument is not a valid MySQL result resource E:\HelpDesk\system\database\drivers\mysql\mysql_result.php 37

And I have identified the culprit to be in the PHP code, but I can't quite pinpoint it. This is the model function:

Code:
function insertAtt($savedName, $realName, $fileSize, $table, $ID) {
    $dt = $this->helpdesk->getDateNow();
    $this->db->query("select @authname := '" . $this->session->userdata('user') . "'");
    $this->db->trans_start();
    $this->db->query("call insertAtts('$savedName', '$realName', '$fileSize', '$dt', '$table', '$ID')");
    $this->db->trans_complete();
    return ($this->db->trans_status());
}

and this is how the controller calls it:

Code:
$this->helpdesk_model->insertAtt(
    entities_to_ascii($this->helpdesk->getFileName($k)),
    $realName,
    intval($_FILES[$k]['size']),
    $prefix,
    $idx
);
$updatesOK++;

I'm quite stumped as to how it would fail, and I'm not sure how to trace it back either; I know this is a long shot, but does anyone see anything blatantly wrong that needs addressing? Thanks in advance, hope someone can help.

[EDIT] It also bears mentioning that all the passed parameters are either strings, or integers, and that the variable names are in proper caps; I checked already.




Theme © iAndrew 2016 - Forum software by © MyBB