Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. ON DUPLICATE KEY will fire when there is a key violation for either the primary key or another unique key. So yes, as long as you have defined a unique key on the columns in question, you can use ON DUPLICATE KEY.
  2. When you make something part of the prototype, you are making it part of all instances. The Prototype is roughly equivalent to a class definition in javascript.
  3. Looks like the same problem to me. mysql_real_escape_string uses an active database connection. It can be explicitly passed as a parameter, but like a lot of mysql functions, if you don't pass one, php tries to find a connection that it can use. This warning is telling you again that the mysql connection it's trying to use is not valid.
  4. I don't think you understand what I was telling you. The connection between the two tables does not need to be, nor should it be the a_id and a_chid columns containing the string 'bgc'. Your primary key for anime (id) is the right way to join the tables. I would have a column in ani_character named anime_id, and in that column would be a 1 for each character that was in "bubblegum crisis tokyo". Quite frankly your structure isn't really right here, because the same character is going to appear in many different episodes, so the actual relationship between anime and character is Many to Many. So really you should have 3 tables to implement what you're trying to accomplish. With that said, you need to read the mysql_query page. When you query you get a result set. You then need to fetch the results, so you'lll loop and fetch each row. I'd recommend using mysql_fetch_assoc
  5. It's telling you clearly you don't have an active/valid mysql connection resource available. It's attempting to make one using user@localhost with no password.
  6. I just gave you the join query. If you have 4 characters for 1 show you get 4 rows back -- one for each character, and the columns for the show will be repeated in each row.
  7. There are a few different syntaxes that work. This is the typical one for mysql: SELECT ani_character.*, anime.* FROM ani_character ac JOIN anime an ON an.a_id = ac.a_chid AND ac.a_chid = 'bgc' Since your relationship here seems to be that anime has "one to many" ani_character rows, I'm not sure why you are connecting these by some redundant column when they should be connected by keys. The Primary key for anime, should be stored in ani_character as a foreign key. Adding this redundant column is just confusing.
  8. I don't really know what your table structures look like so it's hard to advise you.
  9. The number of columns in each result set that you are unioning must be the same
  10. Paymenttech is the main one I've had experience with in the past. Due to the high transaction value, it sounds like you really will want to be aggressive in combatting fraud. Most of the payment processors have ant-fraud addons, but you might be surprised to find that you have to pay more for them, and frequently roll some of your own. Whomever you use, you really want to vet what they have in that regard, and make sure you're using the maximum amount of authentication you can. For example, by default a lot of the api's might not even check that the address submitted matches the cc address -- things of that nature that you would just assume are being verified actually aren't. Otherwise, I would assume it's a matter of getting the best deal you can on transaction fees.
  11. That is not possible. You can not have someone look at data, and at the same time stop them from looking at the data. In order to view a pdf, by it's nature you have downloaded it.
  12. They aren't the same thing but they are packaged together, and have shared code. Pear installs libraries of php code, while pecl installs php extensions which are libraries that utilize the php api to extend php.
  13. Yes, the date has to be checked regardless of the regex used, because no regex can validate a date against a calendar. I do want to address whether or not the javascript is going to be used. The amount of time required to check against the simpler "/d" only ones vs. one that catches dates with months and days that are out of range is going to be the same, so there's no reason not to use one that catches bad dates, however, there is a reasonable argument to be made that on the serverside there is absolutely no reason to use a regex at all, since we all agree that a regex alone can not do the job.
  14. There is no such thing as unlimited bandwidth. The host is constrained by the networking, so when the say that they offer unlimited bandwidth what they really mean is that they have some limit they aren't going to tell you about until you hit it, like their ridiculous 600 pages/5 minutes rule (and that was documented where exactly?) and on top of that, you are hosted on a machine with many other customers, that has a physical limit related to how many nics the machine has and the speed of those. Here's a good idea of the quality of hosting24. First off they are the "paid" hosting arm of a Lithuanian based outfit that has a "free" hosting business, where there are plenty of people claiming that they had an affiliate deal that never paid anyone. All the signs of a crappy company: Lots of obviously planted reviews here claiming how great they are interspersed with real customers who all say that the company sucks. http://www.webhostingstuff.com/review/Hosting24com.html Here's an example:
  15. jQuery has good support for ajax. So you could do your loading of images via ajax if you don't want to have to load them in advance, although for a small number i don't see the advantage.
  16. The regex provided could be moved into javascript so you get some reasonable hygiene clientside.
  17. Yes. You get a xen based virtual private server running a linux distro of your choice. I'd recommend Centos. As one example, this site runs on a 512: http://www.flingbits.com/ and includes not only the full site, but various development and planning tools we use and an irc server.
  18. Yes, linode, aws, something better than hosting24. Most bargain basement hosts seem to have these restrictions. 600 "hits" could happen on one page. If they really mean 600 page views in 5 minutes, that is ridiculous. They sound like total scam artists, who basically want a bunch of people paying them squat per month, but having websites that get little to no traffic, so they can load 500 at a time on one server. We are huge fans of linode here, but they are going to cost you $20/month. I'm guessing you're paying a lot less, but as they say, you get what you pay for.
  19. This is the type of problem session variables are tailor made for. Read out the list of results into an array variable and store that in a session variable, and base your display off that.
  20. I don't think anyone can speak to what your local market will bear, other than developers in your area. What is most important is that you have a good working list of all the items, and that you have done an internal estimation of the number of hours you expect will be required for you to deliver all the work. Then you will have a general idea base on whatever hourly rate you're attempting to work to, of items. Developers tend to underestimate, or work off of "ideal time" so it's usually good to figure in an additional factor. If this scope of work is going to take you by your estimate 16 hours to complete, then you might want to add another 20% onto that estimate. Again this is for your benefit, and unrelated to the client, but if you look at the number of things you have to do and the amount of time it's going to take you, you at least will have a good idea of whether or not your quote is way off. Of course in this case it's way too late, but you want to have an agreement in place with them that specifies the things that you will deliver, so that you don't end up with client-based scope creep where they start adding on a lot of bells and whistles and changes as you work on it. You also typically want to figure on a review/acceptance phase, where they may ask for you to do re-work. For a small project like this, it may be worth it to you to take a bath on the price, simply in order to build up your portfolio, and gain a reference.
  21. Yes basically you're on the right track there. CSS id's are suppossed to be unique identifiers for areas or widgets, so their use for unique menu items is perfectly matched. Obviously you need to associate behavior with the event(s) you want to handle.
  22. What kind of a Piece of shit host do you have? Please let us know the name so we can tell people to avoid them. In a nutshell, yes you can use ajax. In general we advocate that people who don't already have a good command of javascript and ajax used jQuery. With that said what they are complaining about will probably not be satisfied, since the ajax call will still be generating mysql load and bandwidth load. It might make things better if there's a massive amount of queries and things going on with a normal page load. There are ways to ease database load that have nothing to do with cutting down on the number of pageloads -- things like opcode/page caching (APC) and in-memory database caching (memcached).
  23. Exactly as you made the button work. First give the menu items "id='name'" attributes. Your layout would be a lot clear if you used a ul rather than a table, but regardless each menu item needs it's own id. Then associate the onclick with the menu behavior function exactly as you did with the button.
  24. You are using some sort of database class or library, so the solution exists inside it. Along the lines of what Reddix provided you could do: return is_array($data) ? $data[0] : $data; This will handle cases where $data might be an error message. When you use a wrapper library it's up to you to understand sufficiently how it works, and whether or not there is a function/method that is built to return exactly one row.
×
×
  • 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.