Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. I think the OP needs to think more about what to display rather than what to read. The way this kind of thing is done (the same way every time) is to be sure the items are in the right sequence; check for a break in a category and output what needs to be done for that category; then output what is on the current record, remember to display those 'header columns' that need to be reset with this latest change. Remember to check your category changes in reverse order too. The major category, then the 2nd major one, and so on. When a category changes you need to be sure to handle totals for each category below that one as well as the breaking one. Once you figure this out you'll be amazed how easy it is and you'll have the technique for the future in all your projects.
  2. You have a space between your slash and your url name. Specify the url correctly and perhaps it will work.
  3. I don't read external files, so my purpose in answering is to ask if you have made the effort to add some debugging info to your modules to be sure that what you expect to happen is actually happening as the flow passes thru each module. A few echo's can go a long way towards isolating your problem so that THEN you can post the offending (small) section of code and perhaps get a quicker answer.
  4. For those reading along here is my final query: $q = "update tms_test_matchdata p join (select m.* from tms_test_matchdata m where m.Tourn_key='$tourn_key' and m.Printed IS NULL) s on p.Tourn_key=s.Tourn_key and p.Eventcode=s.Eventcode and p.MatchId=s.MatchId set p.Printed='Y'"; Note the placement of the set clause.
  5. Well, I'll be! That worked. Odd - that putting the set at the end made all the difference.
  6. Re: your last As I said earlier I don't know that a huge IN() list would be acceptable. It could have 200+ entries in it.
  7. This is what I'm trying now. <? $q = "update tms_test_matchdata p set p.Printed='Y' join (select m.* from tms_test_matchdata m where m.Tourn_key='$tourn_key' and m.Printed is null) s on p.Tourn_key=s.Tourn_key and p.Eventcode=s.Eventcode and p.MatchId=s.MatchId"; ?> The error I get is check the manual that corresponds to your MySQL server version for the right syntax to use near 'join (select m.* from tms_test_matchdata m where m.Tourn_key='TMStest' and ' at line 2
  8. No they don't. The FldA and FldB that I mention are unique as a combination though.
  9. Let me add some more info to my problem. My data is involved with the game of handball and is the match data for a tournament. FldA represents the event code for the match of which there are many. FldB represents a unique match id for an event code. There can be many similar match ids but NOT within an event. For ex., FldA can be MB, MC or MO. FldB can be R1S0108, R1S0207, R1S0304, etc. These values can exist in every single event, BUT for a specific event only once. My select query has pulled a set of matches (records) that match some criteria and after I have finished using that data I want to go back and post something in one of my tables for every record that was selected and processed. So I want to run an Update query without having to re-generate this huge query again (there are 8 tables in it and there can be upwards of 200 rows in the result). I could re-write the query to only cull out the bare minimum (but essential) data which would use only one table, but I still don't know how to get my update to affect only each of the records in that select query Something like this: update match_table a set printed ="Y" join (select eventcode,matchid from match_table where eventcode='MO' ) b on a.eventcode = b.eventcode and a.matchid = b.matchid is what I'm thinking. Can anyone confirm that this would work?
  10. All three fields are in the same table. My update will only affect one table. The question is - how do I make my update query only update those having the following pseudo-where clause: "update my_table set FldC='x' where (FldA='vala1' and FldB='valb1') OR (FldA='vala2' and FldB='valb2') OR (FldA='vala3' and FldB='valb3') OR (FldA='vala4' and FldB='valb4') .... where my values for FldA and FldB come from the results of a previously generated select query. I could actually create the above query using php but the 'where' clause could be posting 200 records and my thought is that would be one hellaciously long query statement for the server.
  11. As the title indicates, a tricky query problem. I have a set of query results that contain two unique criteria that I would like to use in a second query to update a third field. For ex. My select query yields among other things a FldA and FldB on each record. These are not unique themselves, but as a combination they will select a unique record (Key!!). I would like to take this set of fields and perform an update on a single table where the records to be updated (updating 'FldC') match the FldA and FldB pairs. I have seen many examples but none seem to fit my case, or else I don't understand this fully. Thanks in advance!
  12. Just upgraded my phone to ios 6 and surprise! My web apps utilize the 'type=number' attribute on input tags to trigger the numeric keypad on the iphone of course. They also use the 'size=n' attribute to re-size the input tag to an appropriate width. Well with ios 6 installed my size= values are being ignored. All my input tags are a standard size now and I haven't found anything online to tell me how to correct this issue. Has anyone been using this upgrade long enough to have solved this issue?
  13. You know - you are absolutely correct. I'm going to leave this site. Too frustrated by the caliber of people's attitudes towards teaching themselves something instead of seeking work done by others. Thought I could be of help here, but instead my own principles have made me come across badly here. This topic exemplifies that totally. I apologize to those reading this topic for my off-the-cuff response here. (Can you believe I was a math major 40 years ago?) Good luck to all you newbies.
  14. Add another row to your table, output a '&nbsp' character to all the td elements except where you want to the total, then close the row and the table.
  15. Have you ever programmed before? Use those skills here. You're looping thru all of your results. Accumulate what you need. Then output it at the end of your loop.
  16. Read up in the manual about the while function. After doing a query it is usual to do: while ($row = mysqli_query($myqry)) { do stuff with $row['???']...... }
  17. I don't see any code where you tried to do that sum. You also did a nice job of error checking your connection, but what about your query itself? Bad practice...
  18. You can't do a '+=' operation on something that hasn't been created yet. You should also check that balance is not null before trying to include it. You should re-think your algorithm. You are outputting your file on each and every pass thru the loop. Wasteful. Do it after your loop completes.
  19. Suppose I have to also add: after dumping your query results to 4 arrays - one for each column's contents.
  20. Nested for loops. Look it up. Can't imagine why you would want to do this tho
  21. For this exercise, this has to be a right triangle, correct? Therefore the other two angles have to be 30 & 60. Take it from there. And find a 10th grade math forum for more help
  22. Always do error checking. Your query statement is flawed. If you had checked your query results and displayed MySQL_error you would have caught the error before trying to process an non-existent result. (In case you didn't notice that Neil corrected your query.)
  23. Advice for newbies: Look up the syntax and usage of any function before you implement it. It will save you TIME and FRUSTRATION. (Note: the url to the php manual ("the bible") is at the top of this forum.) For functions that return a value, be sure to check that the value doesn't indicate an error (ESPECIALLY queries!) before you try to use your expected results. It's great that you are intrigued and excited about learning php, but the big part of getting into this is Learning and you won't do that if you don't do some work.
×
×
  • 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.