Jump to content

Janus13

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Janus13's Achievements

Member

Member (2/5)

0

Reputation

  1. Bump just in case there are any other suggestions on this...
  2. The org chart was really just an example of what I'm doing. It's a distributor database, with the tiers not being specifically named, which makes this a bit harder than I'd like, but you have given me a much easier way than I was thinking of trying to do it previously. If, for example, I have people with numbers: ID Upstream A0 A1 A0 A2 A1 A3 A1 A4 A2 A5 A2 As additional people were added it would fan out similar to a pyramid (can't think of a better way to describe it) Each of the entries in the table would be in order by the ID number index, and the upstream column is the number of the person in the organization the person is under. So if I query ID A2 I would want to see everyone under him/her. The tier isn't as straight forward as I would like since I can put tier #'s on everyone, but I also have to tie them to someone else above them that a single number can't do, but I have a new idea that may work. Thanks for the help in getting in a direction that may work. If you have any other suggestions I'd be happy to hear them.
  3. One test you can do to make sure you aren't in an infinite loop would be to echo out each number as it's reached in your loop. Outside of that possibility, I haven't seen that particular error yet. Perhaps someone else has.
  4. Just include them with a relative path include 'file.php'; or include '../file.php'; etc etc
  5. Well you've given me an idea I haven't previously thought of. I'll add a new field, tier (like in your example), and all I really have to do is determine how to assign the tier number dynamically to each new person (since they wont know what that is when they are adding themselves.
  6. this line: $sql = "CREATE TABLE $_POST[table_name]("; should read something like this: $sql = "CREATE TABLE " . $_POST['table_name']; You dont need the ( either. Try that and see if that fixes it.
  7. Not exactly. This is basically going to be for a reporting page. What I need to be able to display could be 2 entries, or 20 depending on how high in the tier the person looking information up is. Think of it like an org chart (just thought of this, and it's easier to explain). Say you have a CEO up top, followed by CFO, CIO, COO, then under each of those areas you have 5 direct reporting managers, then under each of those you have 5 managers, etc etc. Well the main report would be to pull up who is under the person querying.. bascially an org chart query based on the person making the request, so if the CEO pulled the report he'd see everyone, but if the CFO pulled up his org chart he'd only see his information and his part of the chart. Make sense? The bottom level is easy since all that would need to be listed would be the single manager and his/her direct report people in a simple form. It gets more complicated, and it starts to lose me when it gets to the next level, since that person would see himself, his direct managers, but should also see the direct managers employees. Then the next level would need the same.. this is where it gets difficult. Can you do a variable query with a single query with only 2 fields as indexes...
  8. From my experience they are both compare with each other. PHP/mySQL's space is really Linux based servers, and ASP/MSSQL solutions are more for Windows server, although you can put them on either (php will run on windows, and vice versa). It all comes down I think to what you are more comfortable with, and what you are allowed to use (in the case of a company - php/mysql is free, where MSSql server is fairly pricey).
  9. No, I know what they are, it's just that it's a large table so I was trying to keep it in general terms, but if you think he'd help to have all the column names here they are: distributornumber, felonyquestion, associatefelonyquestion, sponsoringdistributorname, sponsoringdistributornumber, sponsoringdistributorphonenumber, placingdistributorname, placingdistributornumber, placingdistributorphonenumber, applicantassignnumber, applicantssn, federaltaxid, operatingcompany, lastname, firstname, driverslicensenumber, address, apptnumber, suitenumber, city, state, zipcode, todaysdate, dob, homephone, cellphone, businessphone, faxnumber, emailaddress, licensefee, subscriptiontype, paymentmethod, draftagreementsignature, draftfinancialinstitution, drafttelephone, draftaddress, draftcity, draftstate, draftzipcode, draftroutingnumber, draftAccountNumber, licensefeeamountcharged, subscriptionfeeamountcharged, drafttotalcharge, directlicensefeeamountcharged, directsubscriptionamountcharged, directtotalcharge, creditcardnumber, creditcardexpirationdate, creditcardcvvcode, cclicensefeeamountcharged, ccsubscriptionfeeamountcharged, cctotalcharge, directdepositbank, directdepositbankphonenumber, directdepositbankaddress, directdepositbankcity, directdepositbankstate, directdepositbankzip, directdepositbankroutingnumber, directdepositbankaccountnumber, directdepositbankaccounttype, agreement, agreementsignature
  10. It's a single table, about 60 fields (columns) in the table. The index is the id number, but there is a second id field for the above tier ID number, which is how I can query the direct line of sight.
  11. Look at Zend as well. They have a compiler that works good from what I've seen.
  12. I'm trying to query information in a db table that is "layered" for lack of a better term. This of it in the sense of a pyramid of information like below, so that you have one or more level 1 people, then under each level 1 person will be multiple people, then under each level 2 person would be multiple level 3, etc etc, if that makes sense. Level 1 Level 1 Level 2a Level 2b level 2 level 2 L3(under 2a) L3 L3 L3 L3(under 2b) L3 L3 The layers can continue for several more layers. I have it indexed by a main ID number that each has, and on each line is the preceding level person's ID. What I need to be able to display is from level x down as far as it goes. So that if I searched on a level 1 entry I want to be able to display all levels under that entry. The initial search is easy enough, but going down additional levels is that part I'm having trouble with. Would it be just a complex SQL query, or would I add additional index entries and search on those? I hope I've explained it good enough to make sense. Any ideas on how I might accomplish the data query? Thanks!
  13. It is but if you don't return it from the function then you can't display it outside of it.  If you want to see it set, then do an echo of the variable inside the function, or return $adminaccess from the function.  But if it is displaying the link to only admins then you know it's working already. [code] function displayadminpanel () { global $dbc, $user_id; $adminaccess = 0; $query = "SELECT user_id=$user_id FROM unc_user_group WHERE group_id=2;"; $result = mysql_query($query); $row = (mysql_fetch_assoc ($result)); if (($row['user_id='.$user_id])==1) { $adminaccess = 1; echo '<a href="admin.php">Admin Control Panel</a>: $adminaccess is set to ' . $adminaccess ; } else { echo 'You cannot access this, $adminaccess is set to ' . $adminaccess; $adminaccess = 0; } } [/code] or if you want to return it you can put just outside the last if...else a return $adminaccess and it will return that variable to the calling page. [code] function displayadminpanel () { global $dbc, $user_id; $adminaccess = 0;         $query = "SELECT user_id=$user_id FROM unc_user_group WHERE group_id=2;"; $result = mysql_query($query); $row = (mysql_fetch_assoc ($result)); if (($row['user_id='.$user_id])==1) { $adminaccess = 1;         echo '<a href="admin.php">Admin Control Panel</a>'; } else { echo 'You cannot access this'; $adminaccess = 0;                                                                        } return $adminaccess; } [/code] Hope that helps! Jonathon
  14. I haven't done it but you should be able to do it fairly simple.  For example if you wanted to add the email address joe@poolhall.com, and you wanted to spam protect it by adding NOSPAM in the middle you could do something like an explode on the text string of the post variable of the email address text box. [code] $email = $_POST['email']; //posted address is joe@poolhall.com $split = explode('@', $email); //splits the email address at the @ symbol of the address $email = $split[0] . "NOSPAM@" . $split[1]; //$email now equals joeNOSPAM@poolhall.com [/code] This seems a simple way to do it.  You could also put some checks to make sure the original email address is a valid formatted email address as well.  Hope this is somewhat helpful! Jonathon
  15. Ok so to get it to work then you'd have be able to overwrite the the globals for username and password, which as far as I can tell aren't possible.  So is there no way to do a SSO (Single Sign On) for Apache like you can for IIS?? I suppose you'd have to do it without .htaccess, but that's just not as secure, and for what I code for people they don't always know PHP so they can't rely on php security pages..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.