Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
dropdown info into db
jamesd116



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

Posted: 04/23/11 20:49 
I had this working once before but since my sites were hacked and deleted I have not been able to get this working again I have tried every which way and searched and worked off other posts/pms I have and several sites i have looked over and over and nothing seems to work can some one look at this and tell me what may be wrong with that I have tried I get no errors at all I just either get a 0 or nothing iinto the db
i ned the result from the drop down to be inserted into the db


Code

    $sql = "SELECT taskStat_name FROM {$jamroom_db['ecmTrackerStat']}";
    $_rt = dbQuery($sql, 'NUMERIC');
    foreach($_rt as $row){
      $ecmTrackerStat[] = $row['taskStat_name'];
    }
    jmSelect($language['ecmTracker'][70],'taskStat_name', $ecmTrackerStat, $_post['task_status']);



_________________
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
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 04/24/11 01:27 
The select array key will start at 0 and you'll have no direct way of then referencing the 'taskStat_name' value back in the DB table when actioning the form. Do you have a 'taskStat_id' field on the DB table? If so, do -


Code
$sql = "SELECT taskStat_id, taskStat_name FROM {$jamroom_db['ecmTrackerStat']}";
    $_rt = dbQuery($sql, 'NUMERIC');
    foreach($_rt as $row){
      $ecmTrackerStat['taskStat_id'] = $row['taskStat_name'];
    }
jmSelect($language['ecmTracker'][70],'taskStat_name', $ecmTrackerStat, $_post['task_status']);


Cheers
Pa


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
jamesd116



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

Posted: 05/02/11 14:44 

pasher:
The select array key will start at 0 and you'll have no direct way of then referencing the 'taskStat_name' value back in the DB table when actioning the form. Do you have a 'taskStat_id' field on the DB table? If so, do -


Code
$sql = "SELECT taskStat_id, taskStat_name FROM {$jamroom_db['ecmTrackerStat']}";
    $_rt = dbQuery($sql, 'NUMERIC');
    foreach($_rt as $row){
      $ecmTrackerStat['taskStat_id'] = $row['taskStat_name'];
    }
jmSelect($language['ecmTracker'][70],'taskStat_name', $ecmTrackerStat, $_post['task_status']);


Cheers
Pa


I have been working on this for a little while now with some luck but not quite doing it yet
with the following line it does post the actual wording taskStat_id into the field but its not actually posting the actual wording from my drop down list

Code
$ecmTrackerStat['taskStat_id'] = $row['taskStat_name'];


I ahve tried different variations to do this including something like


Code
$ecmTrackerStat {$taskStat_id} = $row['taskStat_name'];

although i knew most of the coding i was trying to use wasnt going to be good or real php but i wanted to try somethings before reposting here
just a few notes from my schema to make sure its correct

Table 1
ecmTracker
task_status

Table 2
ecmTrackerStat
taskStat_id
taskStat_name

I want to take Table 2 taskStat_name and place it into Table 1 task_status


_________________
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
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 05/03/11 02:25 
Sorry - I got the code wrong. Try this -


Code
$sql = "SELECT taskStat_id, taskStat_name FROM {$jamroom_db['ecmTrackerStat']}";
    $_rt = dbQuery($sql, 'NUMERIC');
    foreach($_rt as $row){
      $ecmTrackerStat[$row['taskStat_id']] = $row['taskStat_name'];
    }
jmSelect($language['ecmTracker'][70],'taskStat_name', $ecmTrackerStat, $_post['task_status']);



_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
jamesd116



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

Posted: 05/03/11 07:47 
Thanks pasher almost perfect i been working through this and still am
its changing every entry with same selected option if I make another entry it changes it to the new status option


_________________
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
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 05/04/11 01:49 
Not quite sure what you are saying. Is there still a problem?


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
jamesd116



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

Posted: 05/04/11 06:55 
yeah its repeating the selection into the entire row int he db i am working changing everything 1 option at a time to try and see why its changing every db entry
so i create entry # 99 with test status 2
every entry prior to 99 changes to test status 2


_________________
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
jamesd116



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

Posted: 05/04/11 21:57 
fixed thx for all ur help pasher


_________________
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
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.