Jump to content

asmith3006

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

asmith3006's Achievements

Member

Member (2/5)

0

Reputation

  1. I think I like the sound of the duplicate key more (I know how to do them!) Which is 'better' from a database point of view?
  2. Triggers... look promising. Can you give me a quick pointer please? I'm reading the documentation now but finding it a bit confusing.
  3. Hi, I'm having trouble getting my head around INSERT...... ON DUPLICATE at the moment. I have three tables, Product details: id, description..... Categories type, value Product Categories product_id, category_value Example data for the Categories table: height, short height, tall colour, red colour, blue. What I want to do is have no more than one entry for each category 'type' for each product (i.e. a product can be tall and red but not tall and short). I was hoping to do this with INSERT...ON DUPLICATE as this means when a user changes a product from red to blue I don't have to do "if colour exists delete colour insert new colour". Thanks for any and all help!
  4. Oooh I like the look of that. Thanks. End of question.. for now.
  5. Ok, so looking through mysqli it looks much nicer (liking the OO style). Yet another question though, do I need to run ALL queries through Bind or do I just do that with queries with user input in them?
  6. Hi, Sorry to keep asking questions, but I'm new to this. Do I need to use an abstraction layer? Are they more designed for projects that could be run on ANY system rather than a specific setup?
  7. Ok, so I'm writing a new system and have control over the server so I guess MySQLi is the way to go. My next question is, is it worth me writing a database abstraction layer? Is MySQLi easier to just use directly?
  8. So if I use mysqli I don't need to 'clean' the data at all? If I'm writing a new system, should I use mysqli?
  9. Hi, I've managed to setup my debian box with apache, php and ssl but it's behaving a bit strangely. First of all I don't get the $_SERVER['HTTPS'] variable (not shown on print_r($_SERVER) and the port that the system accesses it on is strange. If I type in "http://myurl.co.uk" it works fine, $_SERVER says I'm on port 80 just right. If I then type in https://myurl.co.uk it STILL says it's on port 80. I have to type https://myurl.co.uk:443 to make it go to 443 and then it rewrites the URL as https://myurl.co.uk (i.e. it drops the port number). This is obviously really annoying as it means I need to make all my links :443 from the page to make it work properly. Why is this happening? Thanks Andrew.
  10. I haven't had time to look closely at the code, but try echo $qry['comment']; instead of echo "$qry[comment]"; Do you get any error messages?
  11. If I were to write a function to get user input such as function get_input($name) { if(isset($_POST[$name])) return mysql_real_escape($_POST[$name]); else return false; } And then collect all user input from this function (never directly) then I don't need to 'clean' any of my MySQL queries after that? I suppose what I'm asking is is there any other way of injection attacks (etc) happening? Thanks Andrew.
  12. Humm... you say 'obviously'.... I don't really understand multi-field keys. Can you elaborate a bit please?
  13. Oooohh I like the look of the JOIN one. I will try that. Thanks a lot
  14. What a great answer! Thank you!! Do you by any chance know what program generated that diagram? I've been using Visio but that diagram is MUCH better.
×
×
  • 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.