Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rheide

    (@rheide)

    After further investigation, it appears the issue is actually when it tries to save to the database, not the redirect. Issue still remains.

    I’ve been trying to reap the benefits of all your work here! I’m no PHP expert but I had a bunch of issues with the code that writes the record to the database.

    I have a couple questions if you don’t mind …

    To get the system to write the record to the database, I had to use this:

    // record download
    
    		if(!$is_admin) {
    			$wpdb->query( $wpdb->query(
    						"
    						INSERT INTO $wpdb->wpfilebase_file_download_manager
    						( dl_file_id, dl_file_name, dl_user_id, dl_user_name, dl_company_name)
    						VALUES ($this->file_id,'$this->file_name', $current_user->ID, '$current_user->user_login', '$user_role')
    						",
           					 array(
    						$this->file_id,
    						$this->file_name,
    						$current_user->ID,
    						$current_user->user_login,
    						$user_role
    						)
    				) );
    		}

    Any idea why that worked at the original code did not?

    Although I can see the records in the database, I have yet to be able to get the template part working. I get this error:
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/name/public_html/site.net/wp-content/themes/responsive/download-data.php on line 16

    and line 16 is
    while($row = mysql_fetch_array($userdownloads)){

    and just to clarify, I’m using the latest code in this post

    Any suggestions?

    Thanks in advance!!

Viewing 2 replies - 1 through 2 (of 2 total)