Jump to content

zq29

Staff Alumni
  • Posts

    2,752
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by zq29

  1. i am a beginner but anyways thanks for your help wish anyone could give me a code for this... i am trying to do but everytime something is messing here...

     

    Why not post up what you have done, with an explanation of what it is doing, and what it should be doing. We can then point you in the right direction, rather than doing it for you.

  2. The way I see it, is that a script (or collection of) is not a derivative of the interpreter in any way or form. I think they're talking about someone using the source code of PHP itself and then using "PHP" in the name for whatever it is that was built using the code.

     

    I can't imagine that all of these packages floating around on the web with "PHP" in their title have gained permission for it, but that doesn't make it right. If "PHP" is trademarked, registered or copywritten, you should be asking to use it in any form. But I can't imagine it is, as they're not doing to well at protecting it. Did we get permission to use it in our website name? I doubt it.

  3. "desc" is a reserved word in MySQL, you'll need to surround it in backticks (`) - It is good practice to surround your table and field names with backticks, anyway.

     

    $insert = "UPDATE `inventory` SET `item`='$item', `desc`='$desc', `category`='$category', `qty`='$qty', `cost`='$cost', `retail`='$retail' WHERE `item`='$item'"; 

  4. Something like this?

     

    foreach(glob("/path/to/files/*") as $f) {
        $acc = substr($f,0,strrpos($f,"."));
        $tel = mysql_result(mysql_query("SELECT `tel` FROM `table` WHERE `account`='$acc' LIMIT 1"),0);
        $c = file_get_contents($f);
        $h = fopen("/path/to/files/$tel","r");
        fwrite($h,$c);
        fclose($h);
    }

     

    This is NOT tested!

  5. That would be to transfer the domain to another registrar, such as 123-reg or 1&1, or whatever. You will then pay the new company to renew your domain rather than BT, you'll also have more control over the settings, such as nameservers. To do this, you normally just give BT the new registrars IPS Tag, then they transfer it, you then set-up a transfer in your account with the new registrar to "receive" the transfer.

     

    To avoid all of that though, you just need to ask BT to change the nameservers associated with your domain.

  6. I wasn't totally sure how to define what it is I'm talking about, so I'll stick with "Variable foreign keys" for the time being, until someone can identify what it is!

     

    Consider a scenario where a website is selling completely different types of product with different attributes. For this example, lets say we're selling tickets, packages and memberships. Each of these types of product have their own tables in the database - ticket, package and membership. For the sake of simplicity, there is also customer and purchase.

     

    My dilemma surfaces when deciding how to track the purchase of any/all of these products by a user. The way I see it, I have two options. Using what I have defined as a "variable foreign key", or restructuring the database slightly.


    Variable Foreign Key

    This would be where I have (amongst the usual stuff) the fields type and foreign_id within the purchase table, where type would be an ENUM with the possible values T, P and M (ticket, package, membership) and foreign_id would refer to the id field within either the ticket, package or membership table. This would involve less code, logic and shorter queries, but I am concerned that this might be unconventional/frowned upon in database design.

     

    Database Restructure

    I haven't thought this through to conclusion, but I don't see why it shouldn't work - But this, I'd imagine, would require more work on the scripting / logic side. This would involve the creation of a further table, item, which contains the common fields of ticket, package and membership (potentially id, name, price) and a one-to-one relationship from item to those three tables to cover the uncommon attributes. The purchase table would then just refer to item(id).


    So, are "variable foreign keys" a sensible design decision, would restructuring the database (my way, or a better suggested way) be the more conventional method, or is there a common solution to this problem that I'm just flat out missing? Is this just a silly post? I would have normally just gone with my "variable foreign keys" concoction, but I have recently been re-reading a bunch of resources on database design, relationships and normalization in the hope to get rid of some bad habits I might have picked up since I first learnt database design x years ago...

  7. Personally, I find it a lot easier and a better use of my time to pay someone to do design work rather than piss around for hours in The GIMP (or Photoshop) and still not be happy with the results. A quick search on Google for logo designers unearthed the following sites:

     

     

    Their portfolios look great in my opinion, and I'm sure there are thousands more of these companies around. I think it makes much more sense spending a couple of hundred Pounds / Dollars (or even less than 100 in some cases) for something that will look hundreds of times better than anything I could produce while I'm earning money by doing what I can do well.

     

    I have no affiliation with the websites listed, they were on the first page of Google for my search term.

×
×
  • 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.