Jump to content

Vitamin

Members
  • Posts

    88
  • Joined

  • Last visited

    Never

Everything posted by Vitamin

  1. Ah, ok I just need to think before I go typing all that out, I got it. Just have to make sure the div that I want to show is not enclosed in the click able div!
  2. I have a div that when clicked will slide down. Once it is expanded there are a couple comboboxs that can be chosen. I run into a problem tho, I want the user to be able to slide the div back up when they are done choosing their values in the combo box, but once you click anywhere in the div (including the combo box) the div slides back to the default place. What is the best way to approach this so that values can be chosen from the combo boxes without it sliding back up? Ill post the jQuery script that controls the 2 div's. $('div#runes').click(function () { if ($('#showrunes').is(':hidden')) { $('div#showrunes').slideDown('slow'); } else { $('div#showrunes').slideUp(); } });
  3. what scroll bar are you talking about. The scroll bar in the browser?
  4. I don't believe this can be done because it would cause a endless loop.
  5. Hey thanks for the info. I'll dentally keep that in mind if I ever make a attempt at triggers again.
  6. Server version is 5.5.15. I run it on windows (not sure if that matters). According to the documentation I found what I was doing wrong though. Which was exactly what I was doing. I might mess around with it more some other time, but my new solution works perfectly. Originally I was using the BEFORE, but when I copy pasted my code I was trying the AFTER trigger. Thanks for the help!
  7. Thanks for the help guys. I guess my problem was using the AFTER INSERT instead of BEFORE INSERT. Can't use keyword NEW in a AFTER INSERT trigger. It works now, but I went another way about it in my code rather then using a trigger.
  8. I have a multiple table database. I need to have 1 table that keeps track of 4 of the child tables. The structure of the 4 child tables is as follows. table1-4 id = auto_increment masterid = (Needs to be the ID of the master table) more fields... The master table is id = auto_increment tablesid = The id of the table depending on which table gets a insert. The trigger is this DELIMITER $$ CREATE TRIGGER ins_masterid AFTER INSERT ON `table1` FOR EACH ROW BEGIN INSERT INTO mastertable (id, table1id) VALUES (NULL, NEW.id); SET NEW.table1id = LAST_INSERT_ID(); END$$ DELIMITER ; The trigger is created and runs with INSERTS, but the table1id is not inserted into the mastertable. On every insert the value is 0. Apparently NEW.id in the INSERT INTO line is not the right thing to use. This is my first go at triggers, so any help would be greatly appreciated.
  9. Though I don't general do homework for people. As you just said $delete is not set but you do a if statement on it. Therefor you will not run through that for loop and that is where delete query is.
  10. You have to call getStateName() first function getStateName() { $stateName = array("Alabama","Florida","Nevada"); return $stateName; } echo "<pre>"; $test = getStateName(); echo print_r($test); echo "</pre>";
  11. foreach loops are for arrays and because $days is a int its not going to work. The correct syntax is foreach ($array as $value) { //code } I know that does not really answer your question, but once you put the days into an array it will start to piece it self together
  12. I have this variable that I need to get into my database and I just can't think through it. Here is the code. $sql = "INSERT INTO names (id, name, color, uploaddate) VALUE (NULL,'$master[2]['dbid']','$color','$time')"; I know I need to escape those quotes around dbid somehow, but I can't seam to get it figured out. If I have to I will set it = to a different variable, but I don't want to do it that way if I don't have to
  13. Yes, but you don't really want to refresh the page. You want to use java script to change the values.
  14. Never really read a tutorial that about those sorts of things, but the best resource around is http://www.php.net. In all honesty your problem was somewhat HTML based. The best advice anyone ever gave me when I started to learn php was to echo variables all the time when debugging to make sure they are what you are expecting them to be. Oh and make sure to mark your problem solved. (A button on the bottom left hand of this screen)
  15. You named it LotteryName so you would want to do <?php $lid=$_POST['LotteryName']; echo "lid: $lid"; ?>
  16. Try and echo the variables in question to make sure they are what you expect.
  17. $lname is the value in the dropdown box (the actual displayed value to the user) $lid is the value of the selected option I think that is what you are asking.
  18. Yea that is what I was working with last night. Just read the docs page on it again though (was reading it last night as well). That is where I was going wrong because one of the arrays was 2-dimensional I was not getting the right results. Got it solved now thanks!
  19. Thanks for the hint to array_intersect() never knew it existed. Still not exactly what I'm looking for because it returns the values that are in both. While I want the values that are in one, but not the other. Though I was looking at the doc page for array_intersect() and I think there is a comment in there that will do what I'm looking for. I'll be back if I can't get something figured out.
  20. I have a associative array and I need to compare it to a normal array. associative will have anywhere from 2-8 of these ['name'] ['color'] ['uid'] normal array will have anywhere from 1-8 names ['name'] What I need to do is get the name of the people that are in the associative array that are not in the normal array. I've tried all sorts of different loops and what not and I cant seam to get anything to work in every case.
  21. while($currentlottery = mysql_fetch_array( $lotterynameresult )) { $lid=$currentlottery['id']; $lname=$currentlottery['Name']; echo '<option value="' . $lid . '">' . $lname . '</option>'; } Give that a try.
  22. Maybe I'm mistaken, but don't you want to do addslashes() insted of stripslashes()
  23. What are you trying to fix? You cant send the headers if they are already sent. You will probably have to do quite a bit of re-coding if you want to use the headers to redirect the page.
×
×
  • 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.