Questions tagged [mysqli-multi-query]

Use this tag in case of multi-query execution in mysqli. mysqli_multi_query() executes one or multiple queries which are concatenated by a semicolon and returns TRUE on success or FALSE on failures.

mysqli_multi_query() executes one or multiple queries which are concatenated by a semicolon and returns TRUE on success or FALSE on failures. This can be performed either as procedural style or OOP style(see usage section).

Usage

Object oriented style

bool mysqli::multi_query ( string $query )

Procedural style

bool mysqli_multi_query ( mysqli $link , string $query )
  • bool is the return value type and depends on the passed $variable.
  • mysqli:: refers to the object initialised using stmt_init() or mysqli_prepare() call.
  • $query is the query, as a string. Data inside the query should be properly escaped.

Miscellaneous

  • mysqli_query() - Performs a query on the database
  • mysqli_use_result() - Initiate a result set retrieval
  • mysqli_store_result() - Transfers a result set from the last query
  • mysqli_next_result() - Prepare next result from multi_query
  • mysqli_more_results() - Check if there are any more query results from a multi query

Related tag

173 questions
-1
votes
3 answers

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null in action_login.php

when i log on to my user account it shows these warning:- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /hermes/bosnaweb24a/b1323/ipg.techbitercom1/duracomexteriors/admin/action/action_login.php on line…
abhi
  • 1
-1
votes
1 answer

How to check if id exists in another table with current user not fetch

My A table stored all update of my web and V table stored which update viewed by user. Now I want to create a SELECT statement that not fetch table A's which id's date that id's of table V user_id=session id. Case 1: To fetch all data from table A…
koc
  • 955
  • 8
  • 26
-1
votes
1 answer

mysql group_concat function using sub-query in condition

mysql group_concat function using sub-query in condition I want to try as below : SELECT * FROM prologic WHERE ID IN ( SELECT GROUP_CONCAT( DISTINCT ID ) from ( SELECT GROUP_CONCAT( DISTINCT ID )ID FROM `prologic` GROUP BY Vendor_Code HAVING…
Ajeet Kumar
  • 156
  • 1
  • 10
-1
votes
2 answers

How to insert php array elements into multiple rows in mysql?

I have a php array with 100 elements in it. How can I insert the entire array at once in mysql. Currently, I am inserting 1 element at a time using a loop, as below. for($x=1;$x<=100;$x++){ mysqli_query($Conn,"INSERT INTO mytable (slno) VALUES…
user3652549
  • 69
  • 1
  • 2
  • 8
-1
votes
1 answer

mysql modify select result with insert

I am using insert into table2 select from table1 statement. table2 has few more fields than table1. How can I populate the extra fields with other values in addition to the ones from select result. table1 has col1, col2, col3 table2 has col1, col2,…
-1
votes
1 answer

Do multiple (query) check (optimze) in PHP

i want ask, is there any How to short my script First Check, if get uid, do Second and Third check $result = mysqli_fetch_row(mysqli_query($con, "SELECT MAX(`uid`) FROM `pvpgn_bnet`")); if($result) { Do Second and First Check(); } Second…
Putra Fajar Hasanuddin
  • 1,101
  • 3
  • 13
  • 25
-1
votes
1 answer

MySQL Move Table Contents To a Single Cell in Another Table

Okay, so I have two tables. Lets call them test2 and test2history. test2 looks like this: (source: gyazo.com) test2history looks like this: I need to pull multiple cells from table test2 and make them go into one single cell in test2history. The…
RugerSR9
  • 448
  • 1
  • 4
  • 17
-1
votes
2 answers

PHP Arrays and mysqli multi query

I'm trying to understand two things: If the following is possible; What I am doing wrong with implementing it. I have an array in PHP which is manually coded: $q[1] = 'Monday'; $q[2] = 'Tuesaday'; $q[3] = 'Wednesday'; I have a seperate mysqli…
Homer_J
  • 3,277
  • 12
  • 45
  • 65
-2
votes
1 answer

How to fetch data from two different tables using between statement?

here Iam trying to fetch two table data based on one column 'createdon' and my statement is like below "SELECT * FROM table1 INNER JOIN table2 ON table1.createdon = table2.createdon WHERE table1.createdon AND table2.createdon BETWEEN '$fromdate' AND…
-2
votes
1 answer

mysqli_multi_query and visiable of result on website

When I'm using mysqli_query, website after submitting the form reloads with visible change, but if I use mysqli_multi_query to change more than one table, page display "No result" (or whatever I have set to display if there's no result), but if I…
adi5497
  • 25
  • 7
-2
votes
3 answers

Multi Query for inserting then deleting data

I am struggling to understand how multi queries work. I want to insert data from one table into another, then delete the data from the original table. How can I do this? Is the method below viable?
-2
votes
3 answers

PHP not throwing error for multiple queries

I have some PHP code to execute multi queries and one of the queries has an error in it. But PHP is not detecting it. Here's the code $updateCategoriesQ = "DELETE FROM category_products WHERE product = $id; INSERT INTO category_products…
Whip
  • 1,891
  • 22
  • 43
-2
votes
1 answer

Multiple queries mysqli

I'm trying to input multiple queries guys using mysqli. Yet it's not populating the database. Any ideas? $q2="UPDATE ticketinfo SET ticketstatus = $status where ticketno = $ticket; insert into ticketinfo (remarks) values ('$remarks')"; $ex2=…
Kev
  • 1
  • 3
-2
votes
1 answer

PHP and Mysql multiquery result run multiple times

I'm new to php and mysql, try to use mysql multi query function but it run many times. I couldn't find the logic need assistance. The above mysql query are sample. Like this i have many "select sum()" statement with different condition. so I…
-2
votes
1 answer

mysqli multi_query only works in XAMPP?

I am working on two platforms. One is a Windows 10 computer loaded with XAMPP, and the other is a Mac OS X El Capitan loaded with the default Apache, PHP and MySQL. The goal is to import an .sql file downloaded from a remote server to the local…
ddz1507
  • 37
  • 1
  • 5
1 2 3
11
12