Jump to content

crtreedude

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by crtreedude

  1. I would think you want to look at UNION under MySQL.
  2. Unless I am confused this morning, an Insert never has a where because what you are inserting doesn't exist in the table yet, so why would you care about the where clause?
  3. Got it, so if the job_offering is linked to a user/company pair, and the relationship between the user and company drops, what happens? It seems perhaps that you are assuming that the relationship between a user and company will last as long as the job offering - always. Is that so?
  4. And interesting question perhaps, if a user can only belong to a single company, and a company can only have a single user, why not put user information inside the company table? Unless you have another table which user is connected to directly, but then again, it seems everything is related through company fair warning, I am a real geek on this stuff since I did database design for more than two decades.
  5. Then there is no reason to link job offer to anything other than company, is there? Or can a company be in the list more than once, and the user permits uniqueness? If so, you need to have a separate table for company, and an intersect table between user and company which then can be connected to jobs.
  6. What I see here is a user can have zero to one relationships with a company, so a company can only have one user? If this is true, why bother with user_id in job_offer since by selecting the company, you have selected the user_id Normally I would expect to see a one to many relationship from company to user, just as you have a one to many relationship between job offers and company. Just wondering
  7. Perhaps a couple of questions. How many diseases are there, maximum? What are the reports you wish to produce? How you store the data depends on how you wish to use the data. For example, if you were merely going to show which diseases a person has, there is no need to be able to search on those diseases, so you can do whatever trick you want to compress the data. For example, you could, if you wished, create a binary representation of the options, and store the results of your check boxes as a binary number. Then, when display, decode that binary number and show the diseases. But, if you wish to do analysis on the diseases, then the master / child relationship is a very good one, because though there many be thousand potential diseases, a person normally won't have more than a small subset of those, or one would hope. So, the examples you are getting with two tables are very good. If you develop other attributes, you would wish to put them either in another table, or change your disease table to be something more generic, and a code to say whether it is a disease, an alergy, an injury, etc. hope that helps.
  8. I will second that it is a charset issue. A few useful commands since I just spent 3 days resolving accents in Spanish. $charset = mysql_client_encoding($conn); printf ("current character set is %s\r\n", $charset); This will show you what encoding that your client is using. mysql_set_charset ( 'utf8',$conn); $charset = mysql_client_encoding($conn); printf ("current character set is %s\r\n", $charset); This will set to utf8, and show that it actually happened. Web browsers can show you what encoding you are using on page. Hope this helps. It is worth reading about encoding, character sets, etc.
  9. Sorry, I didn't complete a lot of the statement select * from items a where not exists (select * from Items b where a.itemid = b.itemid and b.primary = 1) I haven't tested it, but something like that should do it.
  10. If I understand correctly, you should use a subquery select * from items where not exists (select * from item where primary = 1) In this way, if the itemid has ANY record where primary is set to one, it will not return that itemid Is this what you are looking for?
  11. It would seem to me that you need a detail table, which uses both your patient and billing table (since it appears your billing table is billable codes or something) You need a table for the invoice, and then you would have the detail for the invoice. Or so I would think.
  12. What if it would take longer to fix the current code? That would be first response, now would it? Another one, a good programmer knows how to use debugging and trace tools, and actually uses them - and if SQL, knows how to profile queries. In other words, a good programmer knows how to use the right tool for the right job, which includes finding bugs and performance issues. He / She doesn't just sit there staring at the screen hoping for divine guidance or something.
  13. Try typing in directly into a field and then reading it back, I bet you find that the Management Studio is not setup to show your UNICODE. I know the Query Analyzer never did - to see the characters, I had to use a program I wrote.
  14. Just a comment - this is the answer. Not to the error, but why you had the problem. Beginning programmers actually think computers do what we tell them, old geezers know better. I have 30 or so years experience writing code and I can tell you it ain't done till you check all the lines. Learn to use debuggers and traces - or pull your hair out. And learn to do unit testing. Okay, ole geezer lecture over, for now.
  15. I good programmer's first response in seeing someone else's code is not to say it needs to be rewritten...
  16. Well, you could if you passed it into a stored procedure, built a string, and executed the string... but you are right. I said it wouldn't be easy...
  17. Since you are building the SQL statement as a string, you can substitute anything for table. What might be more challenging is to have something like "select setting_id from ? where blah blah" which would be attempting to subsitute the table name as a variable, which I don't think can be done easily
  18. crtreedude

    Cannot use ftp

    For Linux, I use the SFTP protocol with Filezilla and it works very well. I am sure I could setup FTP, but it wasn't setup on my Linux box, and so I didn't bother. Hope that helps. Often if you are using FTP you need to set passive mode if it isn't working at first.
  19. Hi all, just climbed on board mainly because I am getting back into programming. I am 49 years old, own my own business (plantations and reforestation) in Costa Rica where we employee more than 40 people. I stopped coding about a year ago after more years than I like to remember (C++, SQL, DSP, VB, 25+ other languages) having gotten tired of debugging the world... besides, didn't need to. Now, I have returned to my roots. I began programming as a hobby, now I am doing it again for enjoyment. We have a fulltime developer, but I don't want him to have all the fun. Married for 28+ years, living in the tropics. I will try not to mention too much about our weather during the winter months up there...
  20. If you are a good programmer, you can know very easily if another person is a good programmer, especially if they have a lot of experience. The syntax of their language while talking to you will reveal much. A person who speaks clearly and to the point, while using constructs that are very similar to programming will most likely be very good at programming - it is because coding has taken over their mind. What you do for most of the day leaves an imprint in your speech patterns. The other thing I used to ask about during interviews was, what equipment did they have at home. Those who had a good hobby system at home often make excellent programmers due to the fact for them, it wasn't a job, but at times, an obsession. And to get some programs right, it helps to be obsessed...
  21. My suggestion is to use the profiler that comes with mssql to capture the query - and see what access is sending. You will probably find the issue then. the problem with tools often like Access is they hide from you what they are sending - and often send very inefficient queries. the profiler that comes with mssql is really a wonderful too. and, if you have to, you can do the same via system stored procedures, but it is messier.
  22. The above comment is correct. in a group by you have the aggregate fields (i.e. sum, count, etc) and you have the fields the determine the aggregate (all of the such and such a date, etc). think of the non aggregated fields as the criteria that creates the groupings.
  23. If the collation is correct, then your problem probably isn't mssql, it is whatever you are using to display the result of your query isn't setup to handle unicode and has the character set to support your language. I did a lot of work with foreign databases, and the mssql side is very simple, but the user interface as to support the characters. Just to be clear, storage is one thing, display is another. mssql only deals with storage.
  24. If you are having a problem updating tables due to permissions, look at the GRANT command. This should help. A way to isolate and to to this is the problem is to see if you update command works just fine if you are the dbo (database owner) - if it works for the dbo, but not for a user, then it is very possible you have a permission issue, which can be solved by granting permissions with the GRANT command. hope it helps
  25. Thank you very much, I knew it was probably very easy, since I couldn't imagine this was a new problem. It worked like a charm. I will try to participate in the SQL forums since I have lots (25+ years) of experience in that.
×
×
  • 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.