Jump to content

Derleek

Members
  • Posts

    297
  • Joined

  • Last visited

    Never

Everything posted by Derleek

  1. Hi, I am developing on a server that I don't really have all that control over... I just started working for a Kiosk company about 3 months ago. I am used to developing on my localhost (MAMP) and porting it to my hosting company. I recently wrote a script that takes advantage of json_decode() and it appears the server I am working on does not support this method... I looked in phpinfo() and on my localhost it has "json support" whereas on this server there is no mention of json in the phpinfo(). The php versions are slightly different... 5.1.6 (json not working) Vs. 5.2.10 (json working) Was json support added between those versions? What do I need to get json_decode()/json_encode() working on this server @ work? Not all that good at this kind of stuff, I try to stay away from configuring anything and just stick to the code when I can... Thanks
  2. The script is breaking on 'options[0].trim()'. It appears there is some incompatibility with this JQuery method and IE.
  3. Hi, Not sure where to even start on this one... I have a function that takes a select input field ID and populates it with an array of options. function populateSelect(selectId, options){ options = options.split(';'); selectId.find('option').remove().end(); $.each(options, function(i, option){ option = option.split(':'); selectId.append($('<option />').val(String(option[0].trim())).text(String(option[1].trim()))); }); } An example call would be... selectId = $("#dateBar_graphSelect"); var options = 'Pie:Pie;Column:Column'; populateSelect(selectId, options); The error I'm getting in IE 8 is... Object doesn't support this property or method (selectId.append line) Considering that line has several methods being called I have NO IDEA what could be going on here. Even a tip on debugging situations like this would do a world of good for me!! -thanks in advance for the help
  4. mysql_close($conn) needed to be executed before I returned 0 or 1... duh!
  5. Hi, I have a *very* simple jQuery/ajax script for a membership driven website. The script just checks to see if the user entered info, validates it against my database and returns 1 for a failed login attempt, and 0 if the username/password match. The function works perfectly when I run it w/o calling it from ajax. **Firefox:** everything works. **Chrome/Safari:** The query is locking everything up. When I enter valid info, there isn't even any record of a request going out (in the developer tools chrome/safari supply). When invalid info is entered the request is going out and it returns 3. I'm pretty baffled by this. Is it a "sandbox" issue? as I understand it Firefox and Chrome/safari handle XHR differently... Although don't ask me how. I am running a base install of MAMP. Could this be something on my developer environment? (I will be testing it on a live server later this afternoon) Here is my AJAX call and the php script it is calling. AJAX: $.ajax({ //I've also tried.. //url: '_modules/php/session.php', url: 'http://localhost/current/100TradeJack/httpdocs/_modules/php/session.php', type: 'POST', cache: false, timeout: 5000, data: "method=login&"+$('#loginTop').serialize(), error: function(XMLHttpRequest, ajaxOptions, thrownError) { alert("ERORR!!"); }, success: function(response){ alert(response); if(response == '0'){ alert("log user in"); window.location.replace("http://localhost/current/100TradeJack/httpdocs/trading.php"); } else if(response == '1') { alert("invalid username/password"); } else { alert("ERRROOR!"); } } }); session.php: $connection = mysql_connect("localhost","root","root") or die(mysql_error()); mysql_select_db("sandbox_members", $connection) or die(mysql_error()); if($email){ $email = mysql_real_escape_string($email); } else { return 1; } if($password){ $password = mysql_real_escape_string($password); } else { return 1; } $query = "SELECT * FROM users WHERE username='". $email . "' AND password='". $password ."'"; $result = mysql_query($query); if($row = mysql_fetch_array($result)){ return 0; } else { return 3; } //if it gets to here the username/password combo was incorrect or was not found in the db return 1; mysql_close($connection);
  6. so... it does work... I needed to divide the dp.Discount_Percent by 100.... it was throwing the whole query off... Delete?
  7. I am attempting to join several tables and I'm unclear on what the correct syntax would be. I think I am just not connecting the tables correctly... Tables: Transaction: Transaction_id item_id 1 1 2 2 3 1 4 3 Transaction_Discount: Transaction_id code 1 123 2 222 //type - 0=DiscountPercent | 1 = DiscountValue Discount: code type 123 0 222 1 DiscountPercent: code percent 123 50 DiscountValue: code value 222 2.00 Item: item_id 1 2 3 Item_Discount: Item_ID code 1 123 2 222 Item_Transaction: Transaction_ID Item_ID 1 1 2 2 3 1 4 3 Schedule: Item_ID Price 1 10.00 2 15.00 3 5.00 I would like to calculate the adjusted price when a discount is applied. Here is my query so far... SELECT *, CASE WHEN td.Transaction_ID IS NULL THEN sch.Price WHEN td.Transaction_ID IS NOT NULL AND d.Discount_Type = '0' THEN sched.Price - (sched.Price * dp.Discount_Percent) ELSE sched.Price - dv.Discount_Value END PriceDiscounted FROM ItemTracker_dbo.Transaction t LEFT JOIN ItemTracker_dbo.Purchase p ON t.Transaction_ID = p.Transaction_ID LEFT JOIN ItemTracker_dbo.Item it ON p.Item_ID = it.Item_ID LEFT JOIN ItemTracker_dbo.Schedule sch ON sch.Item_ID = it.Item_ID LEFT JOIN ItemTracker_dbo.Transaction_Discount td ON t.Transaction_ID = td.Transaction_ID LEFT JOIN ItemTracker_dbo.Discount d ON td.Discount_Code = d.Discount_Code LEFT JOIN ItemTracker_dbo.DiscountPercent dp ON dp.Discount_Code = d.Discount_Code LEFT JOIN ItemTracker_dbo.DiscountValue dv ON dv.Discount_Code = d.Discount_Code LEFT JOIN ItemTracker_dbo.Item_Discount id ON id.Discount_Code = d.Discount_Code LEFT JOIN ItemTracker_dbo.Item iq ON id.Item_ID = iq.Item_ID LEFT JOIN ItemTracker_dbo.Schedule sched ON sched.Item_ID = iq.Item_ID The database relations go as follows (at least I think): Transaction -> Transaction_Discount -> Discount -> discountPercent & DiscountValue Transaction -> Transaction_Discount -> Discount -> Item_Discount -> Item -> Schedule Transaction -> Purchase -> Item -> Schedule Do I need to add some conditional logic for the two different discount_types? I'm not sure If I am selecting from the tables in the right order or not... I really am in a bit over my head here, If you look at the logic in the query it should be easy to see what I'm getting at. The query executes and pulls the first condition perfectectly (if no discount was applied). Although I am getting NULL for entries that do have a discount applied. kudos to anyone who stuck with this long post, it's much appreciated.
  8. here is a MUCH different view. I think this might be more accurate (unfortunately...)
  9. the browser trends in 2009 - according to w3schools.... IE (6/7/8)[/td]ChromeFirefoxSafari -8.5%+6.2%+2%[td]+.9% Good to see...
  10. Exporting a spreadsheet to XML gives a pretty good idea on how to go from XML -> Excel. He's actually approved the pear excel conversion class... It's a pretty easy extension. Although, I am having (conceptual) problems transferring the data returned by my AJAX queries to the PHP script to export to excel... it'll fall into place soon though =)
  11. yes, he is a developer. His main concern is that he does not want to be tied into something that can go away. His Fear: We start to rely on an extension -> The project dies -> we find a bug -> our stuff breaks and we can't get support. Understandable... For bigger extensions. I don't think PEAR is going away any time soon so that one should be fine. It looks pretty light-weight too.
  12. my boss is a turd... He won't even accept PEAR lol
  13. can you just use the file manipulation commands in PHP and save the file as a .xls?
  14. Hi, I am looking to output one column of data in a MySQL DB to an excel file. Is there a way to go about doing this w/o installing a plugin?
  15. hey there freaks! I have taken on a project in which my client wants his user's browsers to update every time he uploads a new video to hi blog. it is imperative that this happens in as close to real time as possible. I started looking into various technologies that allow for this functionality. Here's a couple that I found: Ajax Push Engine (APE) : This is our most-likely candidate. I am proficient with javascript, so this naturally appeals. Also, it is free and looks to get the job done. Erlang: I believe this is an option, although my (senior) partner expressed doubts that it is a bit outdated. I personally think it looks like a viable option. SteamHub: This came highly recommended on Stack Overflow and appears to be viable as well. Although it is a paid service. Just looking for some input/tips/whatever from some people who are more experienced in this kind of matter. As of right now we have the APE server installed on our ec2 instance. I will post my findings! thanks for any input!
  16. I suppose you're right... didn't know you could specify a "i'm feeling lucky" click @ lmgtfy. Thank you for the link!
  17. yea yea yea... cute little link there... I'm asking for non-robot-recommended articles....
  18. Hey there freaks! Just looking for any recommended reading on UML. Books, articles... whatever. is the wikipedia article sufficient?
  19. I've been messing around with installing ImageMagick on MAMP here and there for the past week or so. I finally found this shell script. Which allowed me to install all of the dependencies needed for my ideal developing environment. After banging my head against the wall for a couple days, I figured out that the Imagick extension was not installed. I stumbled upon the command 'sudo pecal install imagick' - although I had no idea if i needed to be in a specific directory within the terminal so i just navigated to where I ran the shell script from. It seemed to go smoothly. I got this message at the end of the pecal install - I then added "extension=imagick.so" in the appropriate line within php.ini - and restarted MAMP. Much to my dismay the error - I'm guessing it's because the file does not exist - infact there is no imagick.so located on my HD. I'm not sure if this conveys where i'm at or not, I will be vigilantly watching this thread if anyone would like me to clarify anything. Thanks for any help.
  20. Well... after proceeding through the rest of the installation with my fingers crossed... The install definitely failed... :'( I'm afraid I'm a bit over my head here...
  21. Hey there, I decided to check out Image Magick. To say the least it has been a pain to install. I run snow leopard. After unzipping and typing ./configure into the terminal. Everything went fine. when I typed - 'make' - into the terminal everything was running fine until it spit me the error - CCLD ltdl/libltdlc.la ./libtool: line 3182: cd: /Users/Derek/Line: No such file or directory ./libtool: line 961: cd: ltdl/.libs/libltdlc.lax/dlopen.a: No such file or directory make[1]: *** [ltdl/libltdlc.la] Error 1 make: *** [all] Error 2 I believe the line 3182 cd was because there are spaces in that directory, which is supposed to be "Line by line". I have no idea what the second error was. I just now renamed the directory to simply - MAMP - and typed 'make' into the terminal again. It seems to be taking off right where it left off (although I have no clue really...). But I seem to be getting a decent amount of warnings... ex:coders/png.c:1018: warning: ‘PNGsLong’ defined but not used coders/png.c: In function ‘ReadOnePNGImage’: coders/png.c:1638: warning: variable ‘image’ might be clobbered by ‘longjmp’ or ‘vfork’ Just wondering what steps I should take to get ImageMagick up and working on my local machine.
×
×
  • 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.