Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
placing info from 1 table into another
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 01/28/11 18:42 
Hello I have beenn for 3 months trying to rework this module since getting my entire site hacked (probably from one of the many scripts i uploaded) the site was hacked and all sites were deleted Thank God I had some what of a database and some files saved but the modules I didnt have saved (lesson learned) I have went through this code over and over again trying to remember how I had it before even from old posts on here I have been trying to reccoup all of the info. The tables are setup to different forms for the modules the main ecmTicket ecmTicket_category ecmTicket status etc prior to this issue of a hack I had it working perfect as of right now I am only able to pull from the status and category db's but I can not send the category/status to the main table. here are the coding from the files

CREATE

Code
    $sql = "SELECT adStat_name FROM {$jamroom_db['ecmClassifiedStat']}";
    $_rt = dbQuery($sql, 'NUMERIC');
    foreach($_rt as $row){
      $ecmClassifiedStat[] = $row['adStat_name'];
    }
    jmSelect($language['ecmClassifieds'][109],'adStat_name', $ecmClassifiedStat, $_post['adStat_name']);


SAVE

Code
$_post['ad_status'] = dbEscapeString($_post['ad_status']);



Code
 $req = "UPDATE {$jamroom_db['ecmClassified']} SET
ad_status = '{$_post['ad_status']}',



Code
 $req = "INSERT INTO {$jamroom_db['ecmClassified']} (
ad_band_id,
ad_status
) VALUES (
'{$_user['user_band_id']}',
'{$_post['status_name']}',


These are just inserts from the files which has the db info the rest of it is just the normal JR template for the jr YouTube if needed i can upload all just trying to make the important parts easy to look over
Thanks James

PS Edit.... I am not getting any errors and I am getting a successful creation its just not placing this one field into the db. I have went line by line in both files make sure the insert into lines had the table I am inserting into ecmclassifiedStat also going off of what I believed to be correct the status_name VALUE posting the adStat_name


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 01/29/11 00:35 
this code looks wrong:

Code
 $req = "INSERT INTO {$jamroom_db['ecmClassified']} (
ad_band_id,
ad_status
) VALUES (
'{$_user['user_band_id']}',
'{$_post['status_name']}',


I think it should be:

Code
 $req = "INSERT INTO {$jamroom_db['ecmClassified']} (
ad_band_id,
ad_status
) VALUES (
'{$_user['user_band_id']}',
'{$_post['status_name']}');
dbQuery($req);



_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/29/11 15:32 
I would make sure to dbEscapeString $_post['status_name'] as well, as that opens you up to SQL injection.

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.