Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Because variables will interpolate within double quotes so you don't have to use concatenation. This way is cleaner and faster (AFAIK). I actually prefer this format: echo "stripslashes({$row['business_name']}) "; that won't work .. i'm assuming you meant to: echo "".stripslashes({$row['business_name']})." "; Actually no, I just had a brain lapse and thought you could execute a PHP function in a string. But yeah, that's the way I would have done it. Because variables will interpolate within double quotes so you don't have to use concatenation. This way is cleaner and faster (AFAIK). I actually prefer this format: echo "stripslashes({$row['business_name']}) "; Except that he already concatenated his string as I point out in the post you quoted. Its wasting processing cycles. I understand that, I wasn't disagreeing even though it seemed like it. I was giving an alternative that he may find easier.
  2. Because variables will interpolate within double quotes so you don't have to use concatenation. This way is cleaner and faster (AFAIK). I actually prefer this format: echo "stripslashes({$row['business_name']}) ";
  3. You never terminate it - . I see you tried to self terminate it but then it wouldn't have a value. Take out the forward slash and end it after business_name.
  4. Have you considered using AJAX? Seems like the best solution in this case.
  5. REPLACE INTO seems to be what you're looking for.
  6. PHP has a function shell_exec that allows you to, well, execute shell commands.
  7. Maq

    Evolution

    Oh the troll came back for more food.
  8. mv I'm sure you could find documentation online...
  9. Well this is the "Website Critique" section, so screen shots are sometimes enough for a critique. There is another section named, Beta Test Your Stuff for functionality, security, etc... A link would be ideal because it enables people to view your site across various browsers and platforms.
  10. Your site requires authentication.
  11. smerny is right, the safest way to get the most recent inserted row's 'index' value is ORDER BY `index` DESC LIMIT 1 Depending on the circumstances, you could also use mysql_insert_id. 'index' is a reserved word, you either have to rename that column or put backticks around it. BTW, I don't see how you're using PHP to get the last row, so I'm moving this to MySQL Help (assuming that's what you're using).
  12. Missing a semi-colon inside your if block.
  13. If you want to retrieve the last value for 'ref_num' then you have to use a combination of ORDERY BY and LIMIT. i.e. SELECT * FROM books ORDER BY ref_num DESC LIMIT 1 I'm not sure why you're using 'mysql_num_rows()' when you only want to retrieve a single record. It's always going to be 1, assuming there's no errors and at least 1 record exists. You also have to use the '$row_getLastRef' associative array to extract the value. $row_getLastRef['ref_num']
  14. Maq

    ++ loop

    Why don't you just use a single query with BETWEEN and if you need the number of rows for the values 1-10 you can just use COUNT and GROUP BY level or gender.
  15. Hahaha, you don't look at the dates either!?
  16. Maq

    I HATE IE

    http://my-debugbar.com/wiki/IETester/HomePage
  17. I think it's great that you posted a potential solution that others can reference, but you do know this thread is from almost 2 years ago?
  18. What leads you to ask this question?
  19. Where's line 213? How do you expect us to help you with so little information?
  20. I've come across them a couple times, they have a wide variety and have always been pretty accurate. I don't go there directly, usually Google leads me there.
  21. http://www.phpfreaks.com/forums/index.php/topic,271298.0.html
  22. Maq

    Error in syntax

    Yikes, inserting POST values directly into your database, talk about vulnerable.
  23. Life's unfair, get used to it. I did read the post and saw your code, it possessed basic mistakes that are mentioned in the first chapter of every PHP learning book. Mikesta is right, my problem isn't that you're a beginner, and by hundreds he means 10's of thousands of beginners, it's that you're trying to perform something intermediate without even knowing the extreme fundamentals of the language. Trust me, it's not frowned upon on this forum, but every programming forum. I have no clue where you got that code from and getting that far with those types of errors is beyond me. If people see that you try and have meticulously read through books and tutorials then yes, people were "a little more helpful". Actually helpful is exactly what I was to you. By you going back to the basics may teach you not to dig yourself in a hole. I'm not trying to be a dick, none of us are, we are all here voluntarily trying to help one another, it's just that you can't just warp to applications like this without knowing what the code is doing. So you don't actually read books, documentation, tutorials etc... ? I don't find you irritating, just the approach you took, or lack there of. I feel it's my duty, and on behalf of the programming community, to give my personal opinion. I assessed your code, the lack of jargon you used in your posts, and thought it would be best if you go back to the basics and learn what the code is actually doing instead of designing code that looks like you copied and pasted from here and there and contrived it together. Yes I understand that. But if you had a student that didn't know what a tire or engine was then you would be irritated, not at the person (well maybe) but the fact that they're basically wasting your time. It's like me trying to build an engine, I know the major components of an engine, but by no mean could I build one. Anyway, this post is getting too long, sorry if I came off as a dick, or still do, but when I see code that lacks the basics it usually means that you didn't even try to learn them.
  24. Your query is probably failing. Echo out $sql and mysql_error() to help diagnose the problem.
  25. I don't think the results you saw were Java, I believe they were Javascript, which is an entirely separate language. Which is actually what you need to accomplish this. There are plenty of examples as you should already know.
×
×
  • 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.