• home
  • forum
  • my
  • kt
  • download
  • How to Concantenate Strings

    Author: 2008-09-12 10:43:50 From:

    A word of warning about concatenating with sql, if the data used is one that is created by a user where query strings are created dynamically, there could be a possibility of an sql injection. This method is best used for outputting information you have in a database. For example, let’s say you have a products table and you want to concatenate the product name and price. SELECT CONCAT (productName, ” , ” , price) FROM products; The output would be: XBOX, $399 You can see the power in this function. We could just as well add some text modifiers: SELECT CONCAT (productName, ” , “”Buy it Now,” , price) FROM products; The output would be: XBOX, Buy it Now, $399 The Concat operator is used mainly by mysql. Other database engines such as Oracle use the “||” operator.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Miscellaneous (13)

    New

    Hot