How to enable PHP short tags?

How to enable PHP short tags?

I have a web application on a Linux server which starts with <?I needed to copy this application to a windows environment and everything is working fine except that an SQL statement is being rendered differently. I don't know if this has to

How do I UPDATE from a SELECT in SQL Server?

How do I UPDATE from a SELECT in SQL Server?

In SQL Server, it's possible to insert into a table using a SELECT statement:INSERT INTO Table (col1, col2, col3)SELECT col1, col2, col3 FROM other_table WHERE sql = 'cool'Is it also possible to update via a SELECT? I have a temporary table

check if row exists with mysql

check if row exists with mysql

I need help checking if a row exists. I am getting "email no longer exists [email protected]". Is there a better way to check if row exists with mysqli?if (count($_POST)) { $email = $dbl->real_escape_string(trim(strip_tags($_POST['em

How to concatenate text from multiple rows into a single text string in SQL server?

How to concatenate text from multiple rows into a single text string in SQL server?

Consider a database table holding names, with three rows:PeterPaulMaryIs there an easy way to turn this into a single string of Peter, Paul, Mary? 1:I had a similar issue when I was trying to join two tables with one-to-many relationship

How to use MySQLi inside a namespace

How to use MySQLi inside a namespace

MySQLi works fine inside a class with no namespace and outside a class. I recently started using namespace and now I have stumbled on a code much like the following: namespace Project; class ProjectClass{ public static function Project

PHP Script to populate MySQL tables

PHP Script to populate MySQL tables

Is anyone aware of a script/class (preferably in PHP) that would parse a given MySQL table's structure and then fill it with x number of rows of random test data based on the field types? I have never seen or heard of something like this an

Left Join outperforming Inner Join?

Left Join outperforming Inner Join?

I've been profiling some queries in an application I'm working on, and I came across a query that was retrieving more rows than necessary, the result set being trimmed down in the application code.Changing a LEFT JOIN to an INNER JOIN trimm

Ubuntu equivalent of Yum's WhatProvides, to find which package provides a file

Ubuntu equivalent of Yum's WhatProvides, to find which package provides a file

Fedora's yum package management tool has a nice option called whatprovides, which lets you find what package has installed a specific binary or file. What is the equivalent command on Ubuntu?For example, say I'd like to find what package pr

SQLite database scheme as Entity Relationship Model [closed]

SQLite database scheme as Entity Relationship Model [closed]

Is there a tool to display the database scheme for SQLite 3 database like with MySQL Workbench and Reverse Engineering? I mean a graphical representation like 1:Try DbVisualizer, it works for any database and I particularly like the way

new mysqli vs mysqli_connect [closed]

new mysqli vs mysqli_connect [closed]

What is difference between the new mysqli and mysqli_connect?I know that executing a query is different;for example: mysqli->query() and mysqli_query()Why are there two different types, what is the need for the difference? 1:One is for P

Where does mysql store data?

Where does mysql store data?

Where does mysql store data? I found out (by using mysql>SELECT @@datadir ) that it's in var/lib/mysql - but that can't be it. I have a quite big database (4 GB) called 'bot', but all the files in the 'bot' subdirectory (var/lib/mysql/bot)

Add sql table column before or after specific other column - by migrations in Laravel 4.1

Add sql table column before or after specific other column - by migrations in Laravel 4.1

Table 'users':|id|name|address|post_code|deleted_at|created_at|and I want add column 'phone_nr' somewhere between 'id' and 'deleted_at'Is it possible by migrations in Laravel 4.1? 1:Yes. Create a new migration using php artisan migrate:

When running UPDATE … datetime = NOW(); will all rows updated have the same date/time?

When running UPDATE … datetime = NOW(); will all rows updated have the same date/time?

When you run something similar to:UPDATE table SET datetime = NOW();on a table with 1 000 000 000 records and the query takes 10 seconds to run, will all the rows have the exact same time (minutes and seconds) or will they have different ti

Is BIGINT(8) the largest integer mysql can store?

Is BIGINT(8) the largest integer mysql can store?

I've got some numbers that is now larger than INT can handle.This is a bit embarassing, but I honestly don't know exactly what the BIGINT(8) means. Is the 8 in that the max bit value or the max length?So BIGINT(1) can only be one digit? Or

Mysql: latin1-> utf8. Convert characters to their multibyte equivalents

Mysql: latin1-> utf8. Convert characters to their multibyte equivalents

There was a table in latin1 and site in cp1252 I want to have table in utf8 and site in utf-8I've done:1) on web page: Content-Type: text/html;charset=utf-82) Mysql: ALTER TABLE XXX CONVERT TO CHARACTER SET utf8_This SQL doesn't work as I w

Tuning MySQL for speedy column/index creation during development

Tuning MySQL for speedy column/index creation during development

Assume a MySQL MyISAM table with one gigabyte of data and one gigabyte of indexes.Furthermore, assume that during development columns and indexes will be added and removed from/to the table quite frequently. Due to the size of the database

“Pivoting” a Table in SQL (i.e. Cross tabulation / crosstabulation)

“Pivoting” a Table in SQL (i.e. Cross tabulation / crosstabulation)

I'm working on trying to generate a report from a couple of database tables. The simplified version looks like thisCampaign----------CampaignIDSource-----------------------Source_ID | Campaign_IDContent--------------------------------------

When and why to use mysqli_fetch_row, mysqli_fetch_object, mysqli_fetch_assoc, mysqli_fetch_array [d

When and why to use mysqli_fetch_row, mysqli_fetch_object, mysqli_fetch_assoc, mysqli_fetch_array [d

This question already has an answer here: mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object 3 answers I understand in some way the differences b

Can you recommend a database that scales horizontally? [closed]

Can you recommend a database that scales horizontally? [closed]

Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option. Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limit

How to select a maximum value row in mysql table

How to select a maximum value row in mysql table

I have the following tableTable structure:CREATE TABLE IF NOT EXISTS `people` ( `name` varchar(10) NOT NULL, `age` smallint(5) unsigned NOT NULL, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Insert some values:INSERT INTO `p

Default index analyzer in elasticsearch

Default index analyzer in elasticsearch

I am facing a problem with elasticsearch where I dont want my indexed term to be analyzed. But the elasticsearch has some default setting which is tokenizing it on space. Therefore my facet query is not returning the result I want. I read t

how to make array_agg() work like group_concat() from mySQL

how to make array_agg() work like group_concat() from mySQL

So I have this table: create table test ( id integer, rank integer, image varchar(30)); Then some values: id | rank | image ---+------+------- 1 | 2 | bbb 1 | 3 | ccc 1 | 1 | aaa 2 | 3 | c 2 | 1 | a 2 |

“General error: 1005 Can't create table” Using Laravel Schema Build and Foreign Keys

“General error: 1005 Can't create table” Using Laravel Schema Build and Foreign Keys

Essentially, I am having the same issue as this guy, minus the table prefix. Because I have no table prefix, his fix does not work. http://forums.laravel.com/viewtopic.php?id=972I am trying to build a table using Laravel's Schema Builder li

ImportError: No module named 'django.core.urlresolvers'

ImportError: No module named 'django.core.urlresolvers'

Hi I am working on Dajngo project where I need to create a form for inputs i tried to import reverse from django.core.urlresolvers I got an error stating that....line 2, in from django.core.urlresolvers import reverse ImportError: No module

Determine longitudes and latitudes within a range

Determine longitudes and latitudes within a range

I have locations in my database. A location has the attributes latitude and longitude (taken from google maps, example: 48.809591).Is there any query that could help me retrieve the locations within a range of another location?Example:I hav