Questions tagged [multi-query]

Used for running multiple database queries/statements. Such as, queries separated by a semi-colon ';' in SQL. Or running multiple queries via separate requests.

SQL Example:

SELECT * FROM table1;
SELECT * FROM table2;

PHP/mysqli example1:

mysqli_multi_query(
    "SELECT * FROM table1;
     SELECT * FROM table2;"
);

PHP/mysqli example2:
This isn't really good practice, compared to the previous example, but this tag would still be fitting for a question with this type of code.

   mysqli_query("SELECT * FROM table1");
   mysqli_query("SELECT * FROM table2");

However, for PHP/mysqli, you should use mysqli-multi-query

84 questions
0
votes
1 answer

Run Multiple queries and one time

Ok! I have a script that is part of a live auction and my code is not all working and I am at the end of my rope! The below code is the two ways I have tried with no luck:
0
votes
1 answer

jdbc sqlite support allowmultiquery

I would like to demonstrate SQL injection using Java and sqlite. I'm attempting to execute two queries at the same time with SQL injection. The user is to prematurely end the statement using ;, then add another entry using an insert statement. Mysql…
Jeremiah
  • 751
  • 9
  • 21
0
votes
1 answer

Mysqli Multi Query - Sort Results

i want to save every result from an sql statement in a differen array. I tried: $sql = "SELECT * FROM `link_server` WHERE `in_use` = false;"; $sql .= "SELECT * FROM `link_queue` WHERE `active` = false;"; if…
user1766080
  • 591
  • 3
  • 6
  • 12
0
votes
1 answer

How to use multi_query with DELETE / UPDATE only?

When I was using multi_query with SELECT, it looked like this: $sql = 'SELECT....'; $sql .= 'SELECT....'; ... if ($db->multi_query($sql)) { do { if ($stmt = $db->store_result()) { while ($row =…
qlt
  • 55
  • 1
  • 3
  • 10
0
votes
1 answer

mysqli multi_query and insert_id gets me Commands out of sync;

I know similar questions have been asked, I've tried a bunch of them (including the php docs) but I don't seem to get this to work. I have the following: $query = "insert into page title values ('v1');insert into page title values ('v2');insert into…
Shivan Dragon
  • 15,004
  • 9
  • 62
  • 103
-1
votes
1 answer

Multiple search with FIND_In_SET

My database structure is as follows : id values 1 10,15,50,89,200,590 2 30,50,89,45,20 3 15,20,40,50,10,500 4 20,30,90,89,50 I want to write a query to filter the data as follows : 2 30,50,89,45,20 4 20,30,90,89,50 That…
Hossein
  • 67
  • 1
  • 9
-1
votes
2 answers

PHP Page Loads Mid-Query (MySQL)

I've got a PHP page with an HTML form on it for the purpose of changing some information in the MySQL database. The form submits to another PHP page that makes about 7-10 queries based on the information received from the form. It's very important…
-1
votes
1 answer

How to execute 2 or more SQL queries in PHP without joining tables

To select data from 1 table I'm using following code: if(isset($UserID)) { $users = $con->prepare(" SELECT DISTINCT d.FirstName ,d.LastName ,d.Picture FROM Details d …
Infinity
  • 828
  • 4
  • 15
  • 41
-1
votes
1 answer

facebook upcoming birthday fetching only this year

i want to fetch Facebook friend birthdays from current date to next year current day . todate is the date 364 days later to now in m/d. for this purpose first fql is to retrieve data from jan to current date and second one is for fetching data from…
hemc4
  • 1,623
  • 3
  • 18
  • 32
1 2 3 4 5
6