0
votes
0answers
23 views

SQL query using Ajax and PHP - mysql_fetch_array() expects parameter 1 to be resource, boolean given in [duplicate]

I've used PHP - AJAX and MySQL this tutorial to make query with ajax but I'm still getting an error Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in Even if I ...
2
votes
0answers
18 views

Subqueries with Load Data Infile

I am having a problem with a particular sub query: LOAD DATA INFILE 'some_address' INTO TABLE 'some_table' FIELDS TERMINATED BY 'field_terminate' ENCLOSED BY '"' ESCAPED BY '\\' ('fieldX', ...
1
vote
1answer
16 views

subselect makes complex query really slow

So I want to do the following for a project. I have 3 tables. First two concern us now (the third is for your better understanding): author {id, name} authorship {id, id1, id2} paper {id, title} ...
-1
votes
1answer
35 views

Working of MySQL Query

I currently want to write a query(MySQL) that satisfies the following conditions Return all rows in which (Column1 != 5 or Column1 != 12 or Column1 != 8 ) Return all rows in which Column2 != 300 ...
0
votes
3answers
40 views

Substring from last index

ABC:123 UVW XYZ NN-000 What is the best method to get the value after the last space using substr()? In this case I want to get NN-000 but also be able to get that last value in the case that it's ...
0
votes
1answer
31 views

Update WHERE Field IN

I've this working query: SELECT idVendRigMov FROM VendRM WHERE idArtPromo IS NULL AND (idArtCategoria NOT IN (SELECT idArtCategoria FROM VendScontiCatEscl WHERE idVendSconti=2) OR ...
0
votes
2answers
73 views

Alternative of NOT IN On MySQL

I have a query SELECT DISTINCT phoneNum FROM `Transaction_Register` WHERE phoneNum NOT IN (SELECT phoneNum FROM `Subscription`) LIMIT 0 , 1000000 It takes too much time to execute b/c ...
0
votes
2answers
40 views

Ordering an SQL query using returned results from a sub query

Hey i am trying to order an SQL query using returned results from a sub query i.e SELECT tb1.stud_id , tb1.stud_name , (SELECT sum(score) FROM scores WHERE student_id = tb1. student) AS total_marks ...
0
votes
1answer
27 views

Return all tree family of a self associate table

I have a db structure like that: Table: cat ( id,fk_cat ,name ) The field id_test pointing to the same table. Ex. Toy > Sports > Ball When i search for Ball, i need also: Sports and Toy. Where the ...
0
votes
5answers
54 views

Using SQL JOIN and COUNT

Let there be two tables, one holding user information and one holding user records of some sort, say receipts. There is a one-to-many relationship between the users and receipts. What would be the ...
0
votes
1answer
28 views

Insert into a table with a select from another table + my own data

I have 2 tables, table1 and table2 in MySql table1 "id" "name" "description" "path" "type" "country" table2 "id" "type" "country" "2" "5" "US" "3" "10" "US" "1" "1" ...
2
votes
1answer
18 views

MySQL stored procedure Error - Create table from param names

I'm trying the following but I'm getting the following error: ERROR 1054 (42S22): Unknown column 'f' in 'where clause' I'm seriously confused because f is a parameter of createtableTest... CREATE ...
0
votes
2answers
18 views

Selecting any one of the IDs of duplicate values to get only unique columns from a table

I have a website with products where some products are duplicated, and the duplication is only because sometimes the same products goes under more than one categories. I just want the unique columns ...
0
votes
2answers
95 views

Taking two sql query into one query working too slow

What I am trying to do is to create 1 query which will do the following check: I've got 2 tables both in 'yesnotmp' database. one is called msg_t which contains all the messages,It has a lot of ...
1
vote
3answers
45 views

Select value which don't have atleast one association

I have a table ItemCategory with category listing and this category is assigned with items. It is like the following: +---------+-------------+ | item_id | category_id | +---------+-------------+ | ...

1 2 3 4 5 1987
15 30 50 per page