Tag Info

New answers tagged

1

PostgreSQL is perfectly fine for this. You got a couple of options to make this work. First of all: PostgreSQL has a special index type for that called GIN (http://www.cybertec.at/gin-just-an-index-type/). It is perfect for full-text-search in general. The cool thing is: In the latest version of PostgreSQL there is support for a thing called jsonb. You ...


1

Show Variables is not ANSI SQL, it's MySQL specific, so it won't run across database providers. Reading through that code it looks like it's trying to determine if the database provider will support UTF8. If you Google it, the Show Variables is a MySQL command which returns information about the current database. I think you will have to replace this ...


0

show variables LIKE '%_database' in MySQL return like following +------------------------+-------------------+ | Variable_name | Value | +------------------------+-------------------+ | character_set_database | latin1 | | collation_database | latin1_swedish_ci | | skip_show_database | OFF | ...


1

I think what you're looking is simply to use INSERT IGNORE. Forget about steps 1 and 2, just insert and ignore :) If you use the IGNORE keyword, errors that occur while executing the INSERT statement are ignored. For example, without IGNORE, a row that duplicates an existing UNIQUE index or PRIMARY KEY value in the table causes a duplicate-key error and ...


0

This works SELECT MONTH(CURDATE()); With the final query like SELECT * FROM tbl_orders WHERE MONTH(date) = @month AND YEAR(date) = @year; Here @month and @year are numeric values from the administrator. Defaults could be SET @month = MONTH(CURDATE()); SET @year = YEAR(CURDATE); This is the quick and dirty solution applicable for a ...


0

The following did the trick. Laravel raw expressions. DB::raw('GeomFromText(\'POLYGON('.$polycoords.')\')


0

As stated in the documentation you do not pass the UID and PWD to utilize Windows Authentication. You can see an example here. From remarks within documentation link: If values for the UID and PWD keys are not specified in the optional $connectionInfo parameter, the connection will be attempted using Windows Authentication. For more information about ...


0

The short answer is yes. The longer answer is yes and I would use a text data type to store the text of the code. The relevant encoding function like mysqli_real_escape_string should make sure that you do not have malformed queries when you insert the code example. When it comes to displaying it later you could use the highlight string function to output ...


2

Here is the query to order it the way the question has it SELECT c.cat_name,p.prod_name FROM products p INNER JOIN category c ON p.cat_id = c.cat_id ORDER BY prod_name; Here is that query formatted SELECT CONCAT('Category : ',c.cat_name,', Product ; ',p.prod_name) DisplayLine FROM products p INNER JOIN category c ON p.cat_id = c.cat_id ORDER BY ...



Top 50 recent answers are included