Jump to content

jadelantern

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by jadelantern

  1. So let me see if I understand this....... PHP is is thought of as a toy language for kiddies because a guy working in MYSQL who already worked on something for a few hours asked for help on a project in MYSQL that never touches PHP..... well... that escalated quickly! Sorry I have just flushed the entire PHP language for all of you by asking for some MYSQL help Ill try not to ask any questions about javascript so as not to ruin Linux for anyone..... thanks and sorry all JL
  2. @Jacques1 I understand what you were trying to do but to be honest I had already written it down and had worked on it for a long while. The reason I came here for help was I was already past that stage of trying to figure it out on my own an needed help from someone else so I don't/didn't really need a life lesson but thank you anyway. @Psycho THANK YOU SOOOO MUCH, i had been working on this for a while and wasn't able to get it and you knocked it out of the park!! THANK YOU THANK YOU THANK YOU!!!
  3. Hi Jacques1 thank you for responding. Im not sure what you mean, but no the year won't always be the same, (say for instance the invoce came/comes in on 1996-12-22 then it wouldn't be processed till 1997-01-09). Plus I don't have the option to just write it down as I was asked to do this and the information will be in the table. thank you! JL
  4. Hi guys, i was having an issue with dates and although it leans a bit more into MYSQL I was hoping i could get some help ive searched all over the net for this so I dont know if im not thinking on how to ask this correctly or can't find it, but ill be as detailed as possible and hope that helps. Ok I have a table that shows when payment was received on past invoices dating back to say 1995; The company processes 'ALL' invoices every month on the 9th, so if anything comes in from the first to the ninth it will be processed that month on the ninth. If it comes in from the tenth to the thirtieth or thirty-first it will be processed the following month. The table already has a "Received" date filed and now I want to create a column on the table called "Processed Date" (adding the column is no problem don't need help with that part) that shows me the date we processed the invoice. I know i have to use the "Received" field (because it shows what day the invoice was put into the system) but im not sure how to format the "Processed Date" field, so say the "Received" field shows an invoice came in on '1995-05-11', I want the "Processed Date" field to display it was payed on '1995-06-09' (notice that is the following month). I thought i would put in a visual of what I was trying to do below: So if I pull the two columns in MYSQL from that table I would see something like this: Received Processed Date 1996-02-03 1996-02-09 1996-03-03 1996-03-09 1996-04-11 1996-05-09 1996-05-20 1996-06-09 1996-07-13 1996-08-09 If i could get some guidance/help on this i would really appreciate it. thanks in advance!! JL
  5. *Just a little update* KevinM1 I think you nailed my problem last time; Wasn't able to see the forest for the trees. Ive been working with loops a lot more in my free time and the project i was giving to re-write some old parsers in our system from JavaScript to PHP have been a breeze! I still need some work on deciding which loop to use where but I feel like this was a major win for me! The first parser i re-wrote loops through and updates anywhere from 5 to 8+ thousand lines of information! thank you guys so much for the help and motivation to keep going and finally knock this out of the park. i'm actually working on the 2nd parser now and everything is going smooth as silk! thanks again guys! JL
  6. right right, forgot to add that extra "i" and ill remember the code wrap in the future! Thank you again! JL
  7. Good morning I got into the office and logged back in... by the way ginerjm I actually already know how to do this: while ($page = mysqli_fetch_array($query_results) { // call a function to do something with the current page of data Do_XYZ($page); } A while back i tough myself how to pull data and populate a table with it; I had always used "mysqli_fetch_array" but at work most of the time we use "mysqli_fetch_assoc" I belive fetch_array holds more information that fetch_assoc but I think I read that somewhere and don't remember. Another interesting thing i learned was when I would pull information that way I always used the field header in SQL/MYSQL as the Key so this never came up but in the query if you put something like "SELECT * user_last_name AS lastname FROM users table"; you can make your own key. I know thats pretty simple but it had just never come up before... anywayz I normally would do something like this (ill skip the connection information part because i have no problems with that): $queryusers="SELECT * user_last_name AS lastname FROM users table"; $query_results="mysql_query($queryusers); $row_query_results($query_results); while ($page = mysqli_fetch_array($row_query_results){ echo $page['lastname']; } This is one that i would consider a little easier... maybe im just over thinking the loop thing? I am starting to really think its more like KevinM said above; My first reaction to loops is a knee jerk "groan" and then I just start looking at a forest and not focusing on "one" individual thing. Edit: i was going to put in the table tags just to show i know how to do that but decided not to as i dont have an issue with those.
  8. Thank you KevinM1 I got this sorted and will be sending you a P.M. shortly ginerjm I don't know if you were trying to help or what and im trying my best to be a nice respectful guy but your posts are really rubbing me the wrong way and you are really coming off as insulting. Let me just say this you can find it as hard as you want to believe or honestly please just keep on thinking im as dense as the keyboard you used to type your last reply but I can say this. If you are a magazine reader depending on what you read (If you rattled off ten or so magazines i could confirm if i did or didn't) I worked for one the largest printing companies in the US for 6 years so there's a better than average chance I worked on the database's used by the accounting department that processed the money earned from that magazine and the user database for company employees. If you are a golfer, depending on where and what course you play on, the software used to make your tee times, process a sale in the golf department and the restaurant or had organized or gone to an event at the golf course theres a huge chance I worked on that software as well (not proud of the Event Planning section of it but what went in and out wasn't my call). The next company I worked for I hated but they did scheduling software and the company was balls to work for so I won't speak on them. Last but not least depending on what hospital's, or doctor's office you go to, if you've been to the doctor's office/hospital in the last 2 years (once again depending on what affiliation's the hospital has) there is a huge possibility these ten little digits directly worked on the software used to put you into the system and the handling processing of your personal data. Not bad for a guy struggling to get a handle on loops huh... Once again you may find it hard to believe but I don't know what to tell you. If you AREN'T being a dick, I have a grey bucket hat that I always wear (fishing hat as my wife calls it even though I don't fish) and i tip that hat to you in thanks for your input, you have something I want and that is knowledge of loops to better myself because I want to take over and become the guy that is responsible for updating our current parsers and creating our new one's and the idea of parsing large amounts of data is just exciting to me. If that makes me a huge nerd then so be it but i love to program and thats why I do what I do. So even if you don't believe what I do or anything i've said, if you still think its impossible for me to have written anything without knowing loops, I guess we'll have to agree to disagree. I really don't want to get into an argument on the internet because I think thats just silly. Plus I don't have that kind of ego so regardless of what you might think or not think about what I do why don't we just say I work at McDonalds or 7-11 and leave that at that. I would much rather have a new friend than an enemy. Thank You! JL
  9. I think you are correct I "KNOW" there is something im missing i just need to find that last piece to the puzzle. Im walking out the door right now to get my car inspected and i will post the reply to this once I get home. thank you JL
  10. Well thanks for the kick in the head mate but i don't need anymore of those as ive managed to do that just find by myself; Also I don't believe im in the the wrong field as ive written hundreds of pages of code in PHP, Java, Javascript unix/linux etc. As ive stated before I have no problems with Array's, entering/retrieving data from SQL/MYSQL databases, ive set up trouble shot and optimized dozens of databases and with my degree in Computer Science I do "Thank you" for replying to my post but but I do believe im in the correct career field and you have no need to feel sorry for me. Also please read where I said i understand simple loops and can do those with "NO" problem and the issue with tutorials i've found is they teach "simple" loops and are too easy thats why i asked if anyone knew a site where i can/could find more advanced tutorials. Because I feel I might not be coming across correctly let me give an example of what I mean, a few years back(maybe 5 - 6 years ago) I bought a chess program that had 10 levels from basically a monkey to a master player. For some odd reason I just couldn't ever beat level 4 (it was a level described as a decent player with decent mid-game skills and knight play but poor pawn movement). I skipped this level to just try some of the other level's out and realized I was able to beat level's 5 and 6 without much issue and off/on could beat 7 but I was never able to beat lv 4. Although I will say responses like yours are the reason I hate asking things on a public form and i wish i would have just P.M.'ed a Mod or another member to ask the question because I dont need to be spoken to like im an idiot or have anyone pity me; Ive seen/heard a lot of people say they have issues with Arrays and that seems unusual to me because I picked up array's right Array (hehe right Array) and didn't have any problem with them at all. matter of fact at first I thought "this is too easy I must be missing something" and kept reviewing them because others were having so many issues with them. So when i see people that do have an issue with Array's I always figure it might take them just a little more time to turn the corner. So thanks for your reply and don't feel sorry for me mate I just need a leg up to turn this corner and finally beat level 4. Thanks JL
  11. To be honest I almost feel silly talking about this because other programmers I speak to all tell me that loops are just dirt easy and I "should not" be having any issue with them but honestly im about ready to pull my hair out. I understand array's no problem but loops always throw me. Ive looked at tutorial sites on loops but the loops are too basic and easy, i need something that's deeper with harder loop examples that I can get into; Does anyone have any idea where i can find some?
  12. So disappointed in myself.... still having all kinds of issues with loops.
  13. Thank you Psycho didn't know how to get the information i wanted. Is the setup to grab the data the same for any API that you are looking to grab information from? Thank you for your help! JL
  14. Hi guys... I was at home and doing some coding and stumbled across and API for a computer game called Battlefield 4 http://api.bf4stats.com/api/playerInfo?plat=pc&name=1ApRiL&output=js; I was checking it out and it is a LOT of data. I was wondering if its possible to only pull certain data from the API, say for instance you only want to pull your user name, ID, and what game you are playing (those are the top 3 things). How would you pull only those 3 stats and display that information on say a webpage for you? thanks guys JL
  15. Thanks for all the help guys I think ill take KevinM1's advice and just practice; I have a raspberry pi mysql server at home so i can just practice loops over and over untill i get them. take care guys JL
  16. Hey guys another question about loops I would love to become strong with them and turn this weakness into a strength, what is the best way to make myself more familiar with loops? I was thinking maybe just try tutorials over and over until something clicked but I don't know if thats the best way and the only tutorials I find are FAR too easy or are on a beginner level. Although I am not where I want to be with loops I am a step above beginner level. thanks guys! JL
  17. ugh... is it really this simple? this makes me want to bang my head against the wall. Thank you for the help QuickOldCar JL
  18. Hi and thank you for replying. I am a Designer for a software company (I know you must be thinking how the heck I did that and not understand loops) and I get some things that actually aren't that difficult but because I don't understand loops im having a HARD time getting things that need loops done. My problem with loops is very frustrating because I understand a LOT of things that are supposed to be harder to grasp like arrays, querying mysql from PHP, retrieving the data and have it populate a table etc. I can do and understand "simple" for loops for example: <?php for($i=0;$i<10;$i++){ echo $i; } ?> I can do stuff like that till the cows come home, but let say i'm handed a spreadsheet full of users and their address, im told the 200 users on that spreadsheet have the correct address and last name and but the address/last name in the mysql user table are wrong so I need to update those user from the spreadsheet. I don't have an issue with connecting to the database and all that, I know how open the .csv and store the address and lastname in variables but this gets to the part where I run into my issues with loops. I have no idea how to setup the for loop to actually loop through the table to find the users and then update their information (this is just a hypothetical scenario); I have to do similar things to this and have struggled with loops. I hope this is a lot more clear and explains what I mean, this is also my 1st and 2nd post so I hope im asking in the right place. thanks guys JL
  19. Hi guys I just wanted to make a short post and talk about an issue im having and maybe get some advice. I know that loops aren't that hard to grasp and I shouldn't be having this much trouble understanding them but im just not getting it. I dont really know how to explain it but loops (like looping through mysql in an update statement) is foren to me and i was wondering if anyone had any advice for maybe learning them or maybe something im just over looking or maybe some good tutorials. I really want to get them down and start using them in scripts i right but im getting so frustrated because i constantly hear how easy they are and im just not getting it. if i wasn't clear please let me know and ill try to explain more clearly thanks guys JL
  20. Hi guys in new here, this is my first post…. I have been using php for a few weeks and I have got to say I love it! I bought a book called “Head first my php and mysql”. I like the book but im getting a little frustrated with it because I see all this really cool stuff you can do with php and the book is really slooooowww! Ive decided im going to try to jump into the forums and try to pick up some things by doing them and analyzing and writing code… im just Anxious because I really like PHP and want to get into it and do more advance things…. But im a jr sql dba from Richmond va, (hopefully relocating to NC sometime soon for a new job working with php), I have 12 – 13 years of i.t. experience but am looking to become an administrator to take my career in a new direction… am hoping to get php, javascript, C# under my belt in the next few years!
×
×
  • 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.