Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [mysqli]

Referred to as the MySQLi extension or MySQL improved extension. Allows access to additional features provided in MySQL 4.1.3 and newer. It is included with PHP version 5 and later.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

$mysqli->change_user returns Access denied NO password

PHP 8.2.14 MySQL 5.7.23-23 - Percona Server (GPL), Release 23, Revision 500fcf5 This is on a shared webhost with CPanel. I'm importing this test script on page load... $conn = new mysqli("...
chillywilly's user avatar
-3 votes
1 answer
21 views

In what format do I need Insert 3 table sql? [closed]

In what format do I need Insert 3 table sql? animals(`AnimalsID`, `Animals`, `IUCN_Red_List`, `TypesID`, `BloodedID`) types(TypesID,Types) blooded(BloodedID,Blooded)
0 votes
1 answer
319 views

Unable to connect to server following phpMyAdmin upgrade from 5.1 to 5.2

Not sure to post on the right StackExchange forum. If not, let me know! Working environment: OpenSUSE Leap 15.4 MariaDB : mariadb Ver 15.1 Distrib 10.7.7-MariaDB PHP 8.0.25 (cli) (built: Oct 31 2022 ...
wiltomap's user avatar
  • 317
0 votes
1 answer
297 views

mysqli_fetch_array exceeds memory

I a running a relatively simple query: SELECT gb2_designs.indx, gb2_designs.response_required, gb2_designs.user_design_name, ...
rob boudrie's user avatar
0 votes
1 answer
76 views

How to get mysqli to read a mysql cnf file

From the command line, one can get mysql and mysqldump to read a config file using --defaults-extra-file. This can contain username and password for connection. Is there a way to get mysqli from php ...
Rohit Gupta's user avatar
  • 1,660
1 vote
0 answers
450 views

MariaDB using 1000+ parameters with EXPLAIN

Can you confirm if this is a bug... I cannot work out if it's MariaDB (10.3.34 or 10.7.3), PHP (mysqlnd), or a mistake I've made: <?php $db = new mysqli('host', 'user', 'pass', 'database'); //...
Craig Francis's user avatar
0 votes
1 answer
106 views

Is a connection from my SSL-secured server to an RDS instance automatically encrypted when using mysqli_connect?

I'm trying to determine if I need to use mysqli_ssl_set to encrypt my db layer. I have a standard Amazon RDS instance that I'm connecting to with MySQL user and pass, but I'm unsure if that connection ...
Tony Friz's user avatar
  • 101
1 vote
1 answer
504 views

UPDATE SET N + 1 equal to a row (with iteration)

Question: How would you iterate over the previous result (referenced below) over for each of the values in column b3? MariaDB Fiddle (this includes prior fiddle information to solve the previous ...
Dr. No's user avatar
  • 45
1 vote
2 answers
18 views

Is it possible to join these both tables?

SELECT u.*,h.*,d.* FROM User u LEFT JOIN HealthDec h ON u.ID = h.EmpId LEFT JOIN Document d On u.ID = d.UserID; and: SELECT count(id) FROM OHS WHERE Category = 'POLICIES' AND ID NOT IN ( ...
pankaj's user avatar
  • 13
0 votes
3 answers
45 views

Deleting rows from multiples tables at once [closed]

I have a question about this piece of code I just wrote. I have a problem with the syntax, the first query executes its purpose, the problem is in the second query which does not. if(isset($_POST['...
jpmer's user avatar
  • 11
0 votes
2 answers
163 views

MYSQL Calculate ranking of row that is not yet inserted

I've got a table similar to this data: | id | username | value | |-----------|----------|-------| | 1 | bob | 46 | | 483 | alice | 90 | | 176 | sue | ...
follmer's user avatar
  • 103
0 votes
2 answers
4k views

Generate invoice number from 0 to so on for ordered products in orders table in php mysqli

I am trying to generate invoice number in orders table, like if user select 1 or multiple products and add it to cart then place order then invoice number should be same in our orders table for that 1 ...
Zain Shabir's user avatar
0 votes
1 answer
118 views

How to perform strictly SQL query that uses multiple values and searches all fields

I'm trying to create what I would call an "inclusive" search and by that, I'm not referring to "between". I have a snippet of code and it does what I need it to do but it's hacky ...
dan178's user avatar
  • 101
1 vote
0 answers
35 views

How to prevent a record from being affected by the ORDER BY RAND() function?

I am building an online exam site using php and mysql. It's just for MCQ type questions. Here is my database structure: 1) QUESTIONS ( Exam_ID, Questions_ID, Questions_Des) 2) OPTIONS ( Question_ID, ...
BlackBeard's user avatar
0 votes
1 answer
21 views

How to prevent a record from being affected by the ORDER BY RAND statement in MYSQL

I have a series of problems all which I can't put in the title but I will try to explain them as best as I can. I am building an online exam platform with PHP and MySQL. Problem 1: Prevent a record ...
BlackBeard's user avatar
0 votes
0 answers
569 views

How to prevent inserting same value in two columns in one Table?

I'm trying to solve problem which will compare BEFORE INSERTING columns values partnerCode and partnerCodeOwner1 with username in the table below, If partnerCode and partnerCodeOwner1 values same with ...
Breaking News's user avatar
1 vote
1 answer
19 views

Get related columns depending on a ID

I have a table with a m:n (many to many) relationship. Basically, if I select an article_id, I want to return all the other articles that have the same tag_id as the selected article_id. | article_id ...
Marco's user avatar
  • 189
0 votes
1 answer
223 views

Why is this blob saving when used as a concatenated string but not as a prepared statement

I have a PHP mysqli prepared statement that looks like this: $editSQL = "UPDATE tblClientReminders SET Header = ?, Notes = ?, DepartmentID = ?, TierID = ?, RemindType =...
Nosajimiki's user avatar
1 vote
1 answer
853 views

Searching through dates query not working?

I'm trying to query the recent week rows by using dates. BUT the query is not returning any result. It takes forever to execute. I checked my DataBase where date is saved in 1446976737 format which ...
DojoDev's user avatar
  • 43
1 vote
1 answer
6k views

Rolling up multiple rows into a single row and column from two tables

Here is my code SELECT register cr.id, register_cr.first_name, register_cr.father_name, register_cr.surname, register_cr....
Mangesh's user avatar
  • 13
2 votes
1 answer
2k views

How to select multiple item from database

Please help me. How to select student result from databese using multiple select. But not work....... My Student Database like - std_profile id StudentId stdName stdRoll stdClass 1 ...
Abdul Azim's user avatar
-1 votes
1 answer
86 views

join 2 table and the value in a specific manner

I have 2 table one is master and another one is the child, now I want to write a query in such a way that all the value from the master should display and the count of that particular parent id row ...
sayyed tabrez's user avatar
1 vote
2 answers
6k views

Avoid Sql Conflicts When Inserting data At Same Time

Let suppose I have a query that runs multiple times because it is in a while loop which inserts data into a table. INSERT INTO <table>( psuiKey, group_id) VALUES ('54ds8a784daEd','1'); The ...
Web Infos's user avatar
2 votes
1 answer
347 views

MySQLI stored procedure return PK/AI insertID

I am using a PHP framework called CodeIgniter for my application. This is using the MySQLI driver for its database work. This framework has built in support for things like a query builder where I ...
SBB's user avatar
  • 161
0 votes
1 answer
4k views

SUM of column by GROUP BY which is WHithin a GROUP BY [closed]

i want to display the rows GROUP BY main Reference Id and then show the amount GROUP BY type. this my query SELECT gl.`drcr`,gl.`amount`,gl.`name`,gl.`type`, gl.`narration`,gl.`main_reference`...
sajeevan's user avatar
2 votes
2 answers
3k views

mysqli large amount of connections

I run a php site with mysqli. I got 3551496 Connections, but there were only 30 processes How can It be What should I do about it? The server is up for 6 month, The problem is that I keep getting ...
user186585's user avatar
2 votes
0 answers
40 views

Query to send users message within a crm

I need help understanding the logic of a query I`m trying to write. I want the employees to be able to message other employees. I need the employee to see the list of all employees he can send ...
Mars's user avatar
  • 65
3 votes
1 answer
2k views

PHP MySQLi Lock Tables Query Sometimes Does Not Complete

I am attempting to lock some tables while running some code and unlocking the tables when I am done. Process: Run Lock Tables MySQL Query. Run some PHP Code. Run Unlock Tables MySQL Query. While ...
Daryl's user avatar
  • 131
0 votes
2 answers
1k views

Between Operator for varchar datatype

I have column 'hdd' having values '1GB','500GB,''1TB' and '100TB' When retrieving rows where value between 1TB and 100 TB like this: select * from product where hdd between '1TB' and '100TB' It ...
sneha's user avatar
  • 1
3 votes
1 answer
17k views

Simplest way to check if current user has permission to a MySQL table (from PHP / mysqli) for some desired operation?

While using an already established mysqli connection to a MySQL database from PHP, I'm looking for a simple way to check if this connection (i.e. the authenticated user for this connection, if any) ...
QuestionOverflow's user avatar
-2 votes
1 answer
50 views

Fetch data from three tables two tables have one same column [closed]

I have three tables a,b,c table a sender status type name1 approved one name1 approved one name1 approved two name2 pending one table b sender p_id name1 001 ...
shailendra's user avatar
0 votes
1 answer
557 views

mysqli importer file - disable foreign keys

I am using this script to import a mysql file but I want to set foreign key checks to 0 when he will do the import. https://github.com/davcs86/php-mysqlimporter/blob/master/php-mysqlimporter.php ...
Sander van Zuidam's user avatar
0 votes
3 answers
10k views

Searching for a keyword across multiple columns

I have a set of names of schools stored in each row in my schools table. the same table has four different category columns which store the names of the subjects they offer. I want to enable ...
Mickey's user avatar
  • 1
0 votes
1 answer
544 views

How to find the most common phrases in a MySQL database

I have a table which contains articles on movies. Each article has a title and many of them have common phrases in them. I would like to do some analysis on the data and extract these common phrases ...
siwalikm's user avatar
  • 111
4 votes
3 answers
61k views

Commands out of sync; you can't run this command now

I have a query which was working fine a few days back: SELECT id, title, details, filetype, filepath, size, details, location, datetime, IF(hid=1, 'Anonymous', ( SELECT ...
SJSSoft's user avatar
  • 141
3 votes
1 answer
1k views

Different types of users in one table, How to add data off different users

I have 5 type of users: Super Admin Coordinator Supervisor Student External Examiner All of them have some common attributes like ID, name, email etc. I have inserted them in one table user ...
Umair Q.'s user avatar
0 votes
1 answer
65 views

MySQLi Tutorials [closed]

I have just finished building my site, and now it's time to finally put a database in it and actually connect it to a database. So far I have downloaded Xampp and installed everything and tested it. ...
DatabaseMan's user avatar
2 votes
1 answer
1k views

Store Mysql Index in separate .Ibd file?

Is there any option to store table index in separate .ibd file? something like file_per_table mode? Becuase my table is growing more than 200gb. Table .ibd file have index for that table also. so If ...
doe's user avatar
  • 41
1 vote
1 answer
162 views

Split Mysql Table internally

How to split the huge mysql table (size around 200GB) internally? Is there any mechanism other than partition? The table size is daily growing. Table created using innodb with indices. Thanks in ...
doe's user avatar
  • 41
0 votes
1 answer
17k views

Select last record from my table [closed]

I am new to SQL and PHP. I'm having a problem with selecting the last record from my table. I run the following query: SELECT * FROM 2521118 ORDER BY id DESC LIMIT 1 My table name is 2521118 and the ...
Panda's user avatar
  • 103
1 vote
1 answer
738 views

Delete rows where matched value is twice as much

I'm trying to match two tables with two columns, table1 and table2. Each has id and price columns. I want the query to match each id and compare the price, then delete the row if the price in the ...
Pierre's user avatar
  • 11
0 votes
1 answer
107 views

How can I connect my other table using the mysqli_insert_id?

I've got a problem like this , I cannot get the id of the parent table . table_name : transaction_tbl - transaction_id -file_name -file_path -description table_name : transaction_details -...
aiai's user avatar
  • 103
0 votes
1 answer
26k views

How to insert multiple values in a specific field in a table using mysqli?

I am working on a project and I I have a scenario like this: I have many field in my table : table_name : transaction_tbl -id -name -description -ref_number : text(datatype) In my inserting here is ...
aiai's user avatar
  • 103
-3 votes
2 answers
37k views

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) [closed]

On my local WAMP stack things are working perfectly. When I upload the database on GOdaddy.com, this error shows up. Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'...
user69104's user avatar
1 vote
1 answer
4k views

Calculate total attendance for each workshop

I want to get overall attendance in each workshop. NumberOFWeeks column holds the number of weeks the workshop runs. for example Workshop 101 runs for 6 weeks meaning 6 days. So far I have done this ...
Ali Shaikh's user avatar
0 votes
1 answer
4k views

Error: Incorrect usage of UNION and ORDER BY

I have this query: SELECT DISTINCT CONCAT (MONTH(`Date`),'-',YEAR(`Date`)) from wp_result_plugin WHERE Bet=2 AND month(`Date`) = EXTRACT(month FROM (NOW())) ORDER BY MONTH(`Date`) ASC UNION ...
zeeshan's user avatar
0 votes
1 answer
181 views

Returning auto-generated primary key after SQL insertion

I am trying to submit data to a database and then have it return the value of the user_id (primary key) created by the insertion, but I can't get it to return the value. I use the same query in ...
CR_BU's user avatar
  • 17
0 votes
0 answers
56 views

How to group two query that have already been grouped

I am creating a chat system and i have two queries: The first query selects the Max(id) meaning the last message that has been received or sent by the member that is connected and that has not yet ...
Man Of God's user avatar
-1 votes
1 answer
142 views

Update multiple meta_value with single query

Here is a similar structure of a table that I am working on. |--ID--|--user_id--|--meta_key---|--meta_value--| |--1 --|--444444---|--first_name-|------NULL----| |--2 --|--444444---|--last_name--|-----...
brandon-estrella-dev's user avatar
1 vote
1 answer
6k views

Can't insert arabic text into mysql database using mysql prompt

I had a local table with arabic values.when exported i got the following query. DROP TABLE IF EXISTS `type`; CREATE TABLE IF NOT EXISTS `type` ( `bs_id` int(11) NOT NULL AUTO_INCREMENT, `types` ...
AVM's user avatar
  • 141