Jump to content

silkfire

Members
  • Posts

    569
  • Joined

  • Last visited

Everything posted by silkfire

  1. Sigh Gareth...echoing HTML with PHP is a nasty habit. And people think you're trolling, too.
  2. I figured it out. ON DUPLICATE KEY UPDATE does not allow a WHERE clause.
  3. I made this query and looked through the manual and as far as I'm concerned can't see what's wrong with my query. Why are MySQL errors so extremely unhelpful? Surely they could've improved the parsing engine by now? INSERT INTO `$batch_comments` (`plant`, `sap_code`, `batch`, `reason`, `comments_sm`, comments_sc) VALUES('SE23', 'PAN-6587', '165701C~', 'wohooo', '', '') ON DUPLICATE KEY UPDATE `reason` = 'wohooo', `comments_sm` = '', `comments_sc` = '' WHERE `plant` = 'SE23' AND `sap_code` = 'PAN-6587' AND `batch` = '165701C~'
  4. Gareth, I can help you out by email. G
  5. Dunno but your logic seems a bit flawed. 1. "SELECT `level` FROM users WHERE `level` = 1" does not make sense. That will give you a bunch of 1's. 2. If you only pick those users with admin privileges, then why do you need "if ($admin)" in the first place?
  6. Well if you know admin is level 1, why don't you just make a query: ...WHERE `level` = 1. I don't see the difficulty in this?
  7. That's what you use the great abundance of string functions you find in PHP for. In this case you are to extract a substring of 200 characters from your string: echo substr($row['intro'], 0, 200)
  8. A little tip from me: Always start the date from 1, because that day is guaranteed to exist in any month any year. January 31 + 1 month is 2 March, so it will skip February.
  9. What do you mean by "style XML" ? XML is pure information in tags, this is not HTML. I suggest you insert all the data into a temporary database table, then select the data and sort on Approved_On column.
  10. 1. There's no way for the user to delete or change the picture any way, why are you worried? 2. Ye, try that.
  11. You can store that data in a separate attribute starting with 'data-': <a id="...." href ="......" data-number="1234">.......</a>
  12. If your using jQuery don't use inline JavaScript. It has a css selector engine that enables your code to be separated from your markup. Exactly. Using "onclick=" attribute was popular in early 2000s but now with jQuery that is completely unneseccary.
  13. Don't feed the troll
  14. This has nothing to do with what the first day of the week is... I just ran your code and got this: string '2012-05-14 00:00:00' (length=19) // Last Monday string '2012-05-20 23:59:59' (length=19) // Last Sunday What results do you get today, Monday, 21 May?
  15. You should probably use AJAX with jQuery for this not dump variables into the attribute of the link.
  16. 1. Do you want the pictures uploaded not to be accessible by users? When you upload a file to the server it's stored in a hidden temporary file so don't worry about that. By moving the file from the temporary location to a place the user cannot access it you have control over where the file resides on the server. 2. Are you using Windows? Probably you need to have write access to the parent folder.
×
×
  • 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.