Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Muddy_Funster last won the day on April 25 2017

Muddy_Funster had the most liked content!

Contact Methods

  • Website URL

Profile Information

  • Gender

Muddy_Funster's Achievements

Regular Member

Regular Member (3/5)




Community Answers

  1. No, you can't bind column names as parameters. This is going back to what I said about maintaining dynamic where clauses.
  2. There should be more to that PDOException error that tells you exactly what the problem is - such as parameter type mismatch, different number of parameters to placeholders etc. Some other things though: Purely dynamic WHERE clauses are a big potential security flaw, not to mention an absolute ball ache to manage, and you should try really hard to avoid using them at all. If you want to be able to use COUNT(*) in a meaningful way you should alias it eg. "SELECT COUNT(*) as totalNumber FROM ..." There is no need to prepare() a flat SQL statement such as "SELECT something FROM somewhere" as there are no parameters being passed to it - you should user PDO::query - for SELECTs - or PDO::exec for other query types in this situation. Also, rather than looping through the $param array it would be more efficient if you just passed the array into the $stmt->execute($param) like that. To do this though you will probably have to change your $and_terms[] to "{$field} = ? " and then your $param[] = array($_GET[$field]) As PARAM_STR is the default for PDO parameter types and you are not applying that conditionally there is no need to have it in there.
  3. It's OK, you don't sound ungrateful - condescending, yeah, but not ungrateful. Well, using an unsigned, auto_inc bigint datatype gives you up to 18,446,744,073,709,551,615 possible records. How many more "combinations" could someone need? Actually...what do you even mean by "combinations"? I don't know if we're missing some information or your just not open to the idea that what you are trying to do is not best practice. Even the database system itself uses auto_inc data types to manage it's internal tables and referencing. To be honest, and I'm not trying to be flippant or nasty when I say this, if your heart set on ignoring us and doing it the wrong way then you would be better off talking to someone at that University of yours.
  4. Couple of things: 1> your first code block is screaming "Infinite Loop" at me. It may not be for every occurrence but I can't see why you made it a loop at all, you really shouldn't ever run queries inside loops unless you absolutely have to. 2> What's the nature of your ID column and why are you setting it manually? Manual setting of ID fields is a bad idea and can lead to serious (i.e. break the whole system) difficulties when multiple users start using the app at the same time.
  5. CloudFlare could be worth a look.
  6. I agree, I don't think "what's the best" is an accurate question when it comes to code editors/IDE's. What is a feature to one group can be a pain in the backside for another. I don't think that there is a universal right answer, although there may be, I have used a pitiful number of applications to code in. I do like it simple myself, and have been prone to using PSPad for a number of yeas now. I drifted into using eclipse for a little while, but setting up workspaces and projects was too much of a pain in the backside after a while and I just gave up. I also couldn't be bothered with the load up time of starting eclipse every time I wanted to go in and do a bit of coding. I have just recently started using an IDE/editor called CodeLobster, and I have to say, I'm quite liking it. It doesn't suffer from PSpads single most infuriating habit of auto closing absolutely everything as soon as you open it. i.e. you type a double quote and instantly you have two on the page, one in front of the cursor, and one behind. It drives me nuts. Code Lobster also has an integrated debugger - which I haven't trued yet, but if you set up your webroot it lets you preview pages in a single click, without having to change window and hit f5. Like other environments it lets you change the color theme in as few as 4 clicks (choices include all the popular editors), offering a preview of how each theme looks on each type of code (CSS/PHP/HTML/etc.). All in, it's shaping up to be a pretty polished bit of software. The basic version is free with the option to spend a nominal amount to upgrade to lite or a bit more to get pro. I was going to go into the differences but read through it and it looked like a rather shameless advert, so I deleted it and I'll leave it there.
  7. ensure that your From: address is a proper and legit' email address from a recognised domain.
  • 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.