Tag Info

New answers tagged

0

The query db.cars.find( { "car_type" : 507c35dd8fada716c89d0013 } ); actually would be used and imho is the best solution in this case. In order to make this query efficient, however, you would create an index db.cars.ensureIndex({"car_type":1}) In this case, linking two documents makes sense. There are other relations in which embedding documents ...


0

In MySQL, or almost any other RDBMS, it is common to have an ID for the row (object), so you use it in other tables to make a link between the tables (Relations, or PK and FK if you prefer). This is part of the normalization process that is recommended for most types of DB design [there are exceptions though]. In MongoDB however, the general way or design ...


0

If you have access to the database, Echo (instead of run) your variable with SQL command and then put that command into SQL server and see what error you have there. $tsql2 = "INSERT INTO pedidos (numero_local, emailUser,codigopapel,cantidad, color) VALUES ('$local', '$emailOn', '$codigopapel', '$cantidad', '$selectcolor')"; /* $stmt2 = ...


0

As in http://stackoverflow.com/questions/17148144/insert-into-sqlsrv-query-statement-not-working .. you might try die('Errors: ' . print_r(sqlsrv_errors(), TRUE); .. or something like that. (I don't know PHP.) Also, use placeholders (?) for values, then pass your parameters. If you just interpolate strings into your SQL literally, you may be vulnerable to ...


1

This does not make sense: INSERT INTO pedidos VALUES((SELECT numerolocal FROM localidad WHERE numerolocal = $local)) You haven't specified a column list, so this should fail with a syntax error (since your table clearly has more than one column). Formats for INSERT are typically: INSERT dbo.table(col1, col2) SELECT col1, col2 FROM dbo.othertable; Or: ...


2

In your question, there is not enough information to see where the problem is from technical point of view; however, I can see that there is a problem in communication between you as developer and the DBA. This is not abnormal though as DBAs and devs do not always 'speak the same language'. Let's go the some points in your question: You should rely on the ...


0

Could this be a double-hop delegation problem since apparently Kerberos is not being used? Every machine in the chain, from the workstation to the database needs to use Kerberos authentication. You mention visiting the page, which then queries the database. Which could be interpreted as a double-hop, although I do not fully understand the topology from ...


0

Try creating a view with all the joins in it, using MySQL. Measure the performance of this view in both MySQL and via PHP. Hopefully, this technique will cause the database to use the same join strategy with the PHP query that it does with the MySQL query.


1

Reading the manual I found something relevant: For example IIS 7, in its default configuration, has anonymous authentication enabled with built-in user account IUSR used as a default identity. This means that in order for IIS to execute PHP scripts, it is necessary to grant IUSR account read permission on those scripts. If PHP applications need ...


0

"The IIS pool is running under a Windows domain user "domainadm" which has access to the SOME_DB database and the server it sits on." can you check if the user that you are trying to authenticate has been added to the security group on the dB server where your schema is located and the security login for that user is created with serveradmin access.


1

This will work for you: require("configs/conxao.php"); $datas = $pdo->query("SELECT p.ID, p.post_title, pm.product_img1, pm.product_img2, pm.product_img3 FROM wp_posts p JOIN wp_postmeta pm ON p.ID = pm.post_id WHERE p.post_type = ...


0

The difficult part seems to be defining the schema in a way that makes the query to calculate the total cost manageable. One part of this is the use of the datediff() function to determine the number of days in an interval so that it can be multiplied by the daily price for that interval. On this type of approach, we'd need a query that provides a row for ...


3

SELECT p.ID, p.post_title, ProductImage1.product_img1, ProductImage2.product_img2, ProductImage3.product_img3 FROM wp_posts p cross apply ( select top(1) pi1.product_img1 from wp_postmeta pi1 where p.ID = pi1.post_id and pi1.meta_key = 'product_img1' ) as ProductImage1 cross apply ( select top(1) ...


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 ...



Top 50 recent answers are included