Jump to content

random1

Members
  • Posts

    425
  • Joined

  • Last visited

Everything posted by random1

  1. Hey All, I'm trying to apply a 'color scheme' to my CSS stylesheet. In my sheet I have selectors for body and #footer. I have this code at the bottom of the file: /* Start Green Scheme */ body { background-color:green; color:white; } #footer { background-color:green; color:white; } /* End Green Scheme */ Yet they don't apply. Isn't CSS processed by the browser top down with repeating selectors at the bottom taking precedence? Any suggestions?
  2. Thanks for the help guys.. much appreciated. In my app I'll give the user the choice of text or HTML emails and also keep it as simple as possible. :D Cheers
  3. Hey All, I've created a useful generic "INSERT" stored procedure that I want to use within other stored procedures I'll create. Can one stored procedure 'call' another stored procedure and set thre results to a variable within itself?
  4. Hey All, I'm currently working on HTML email styling and have a question about it. Should CSS styled HTML emails have just the body HTML and "<style type="text/css">" code above it or should it contain the structuring tags of an HTML document (head, title, body etc) to be validate correctly?
  5. While trying: mail('myemailaddress@gmail.com', 'hi!', 'message'); I'm getting the error: Warning: mail() [function.mail0]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in .... etc In my php.ini I have: [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com I'm using SmarterMail. Any ideas?
  6. Yes I created the PK first. The BIGINT supports my efforts for 32-bit and 64-bit compatability.
  7. I have two columns on two seperate tables that are IDs, one is primary and the other is not primary. `version_id` BIGINT(50) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'The ID of the Version' `versionchange_version_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The Name of the Version ID' When I try to create a FK relationship I get the error: /* SQL Error (1452): Cannot add or update a child row: a foreign key constraint fails (`webman`.<result 2 when explaining filename '#sql-704_8'>, CONSTRAINT `FK_version_change_version` FOREIGN KEY (`versionchange_version_id`) REFERENCES `version` (`version_id`)) */ To set up a foreign key relationship do both fields need to be AUTO_INCREMENT? I am using InnoDB with the latest version of MySQL if that makes any difference.
  8. By the way I ran: show variables like 'colla%'; on the database and I get: utf8_unicode_ci for all the variables.
  9. I have the stored procedure: CREATE PROCEDURE `procedure_currency_update`(IN `pRate` FLOAT, IN `pCurrencyAbr` TINYTEXT) LANGUAGE SQL NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT 'Updates a currency in the \'currency\' table with new rate info.' BEGIN /* Version 1.0a */ /* Update a currency with a new exchange rate and the last edited datetime */ UPDATE `currency` SET `currency_exchange_rate` = pRate, `currency_datetime_utc_last_edited` = UTC_TIMESTAMP() WHERE `currency_abbreviation` = pCurrencyAbr; END I call it like: CALL procedure_currency_update(1.4641, 'AUD'); The error that MySQL reports is: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=' I checked the 'currency' table and it is utf8_unicode_ci. Any ideas why there is a mismatch of collations? Help with this would be much appreciated.
  10. I'm starting to learn about MySQL Events. What some good examples of SQL statements that should be run as events? Say every 15 mins? Are events mainly used for maintenance actions? Such as updating and deleting?
  11. Thanks Mchl that worked. Not a bad workaround at all I found out. All the Best, - Dean
  12. I'm using backticks because I've read they are best practice: -- Using "backticks" on database and column names avoids any issues where the entity name is a reserved word -- For example I can have a table called 'user' but I surround it in `` it avoids any conflict with the reserved word 'user'. @Mchl : That's a pretty big work around :S ... I'll have a look at it and see if I can apply it to my code. Thanks for the help
  13. I have created the stored procedure: CREATE PROCEDURE `procedure_search`(IN `pTableName` VARCHAR(50), IN `pFieldName` VARCHAR(50), IN `pSearchTerm` VARCHAR(50), IN `pOrderTerm` VARCHAR(50)) LANGUAGE SQL NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT 'A procedure to search tables.' BEGIN /* Searches a table or tables for a search term */ SELECT * FROM pTableName WHERE pFieldName LIKE pSearchTerm ORDER BY pOrderTerm; END I'm trying to create a generic, useful MySQL search function. How can I fix it to stop complaining about 'pTableName' when run and also fix it so that the like statement has '%' correctly for syntax for the LIKE statement? CALL `procedure_search`('user', 'user_username', 'dean', 'user_username'); I get the error message: /* SQL Error (1146): Table 'database_core.ptablename' doesn't exist */
  14. Hey All, I'm looking for some advice about web development and SVG. Source: http://en.wikipedia.org/wiki/Scalable_Vector_Graphics The main reason I'm looking into this I have some icons that I'd like to resize with the same sizing. i.e. When you zoom in on a web browser the icon (image) scales up too. Does SVG do this and how can you insert a scaleable solution? Some reference: http://maxolasersquad.blogspot.com/2009/08/svg-with-webpages.html
  15. The books that got really into PHP and MySQL were: - Wicked Cool PHP - PHP Phrasebook - MySQL Phrasebook Highly recommended :D Also get used to searching google.
  16. Finally found it at: http://www.utf8-chartable.de/unicode-utf8-table.pl?start=9984&utf8=-&unicodeinhtml=hex&text=9654
  17. I'm trying to get a list of the symbols that work on Windows, Mac, Linux. For example: ✉ Email ✍ Edit ✎ Create ✓ Correct ✗ Incorrect ☑ Ticked ☒ Crossed ♫ Listen to Music ✄ Cut ✁ ☢ Radiated ✈ Book Flight ♂ Male ♀ Female Arrows: ⇐ ⇑ ⇒ ⇓ ⇔ Is there a full list to refer to for ASCII and UTF-8? Are there ones for simple things like add user, remove user, modify etc?
  18. Hey All, Is there a way to make a generic search function in MySQL? I have the code so far: SELECT `product_name`, `product_description`, `product_price_euros` FROM `product` WHERE `product_status_id` != 0 AND `product_name` LIKE '%S%' ORDER BY `product_name` LIMIT 10; I'd like to create a procedure/function from this that can be used to search any table in my database. Any ideas? Can I set up parameters and pass them as normal?
  19. I've created a MySQL database that support UTF-8 for foreign languages (such as Japanese). It uses: InnoDB storage engine UTF-8 character set utf8_general_ci collation When you use the 'utf8_general_ci' collation in MySQL what does the 'ci' part of 'utf8_general_ci' imply, I've heard that it's "Case Insensitive" but what impact does that make? The purpose for why I'm currently using this collation is for supporting languages like: German, Korean, Japanese, German etc..
  20. Thanks I ended up using: http://www.venus.dti.ne.jp/~swe/program/qr_img0.50i.tar.gz Calling it using: php/qr_img.php?d=http://www.example.com/454 Cheers
  21. Source: http://en.wikipedia.org/wiki/QR_Code How can I create QR Code images in PHP? Best output would be transparent PNGs Any ideas?
  22. Hey All, I've created a table: CREATE TABLE `product_category` ( `productcategory_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The ID of the Product Category', `productcategory_parent_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The ID of the Product Category\'s Parent', `productcategry_status_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The Status ID of the Product Category', `productcategory_name` VARCHAR(100) NOT NULL COMMENT 'The Name of the Product Category', PRIMARY KEY (`productcategory_id`) ) ENGINE=InnoDB ROW_FORMAT=DEFAULT This table holds the categories that I want to link to my 'product' table. I've looked at: http://www.sqllessons.com/categories.html as a starting point. Is there a standardized structure of handling categories for products, services, items etc? The structure needs to allow for categories having parents and for subcategories. E.g: Food > Fish > Fresh Water Fish ...... Any ideas?
  23. I am currently using VARCHAR(255) for some text fields in my database. I have a few fields like: page_title - should be max 50 characters long page_content - should be as long as possible page_keywords - should be max 100 characters long Should I be using CHAR or TEXT instead for these fields? I am trying to improve performance and data integrity.
×
×
  • 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.