mysqli

PHP bind_param not defined [duplicate]

爷,独闯天下 提交于 2019-12-24 13:49:07
问题 This question already has answers here : Fatal error: Call to undefined method mysqli::bind_param() in (3 answers) Closed 4 years ago . I am working in MAMP trying to make a login function. My connection code is: $servername = "localhost"; $username = "root"; $password = "root"; $db = "world"; $mysqli = new mysqli($servername, $username, $password, $db); if($mysqli->connect_error){ die("Connection failed: " . $conn->connect_error); } My login function: if (isset($_POST['email'], $_POST['p']))

How to return array while using GROUP BY

自闭症网瘾萝莉.ら 提交于 2019-12-24 13:39:23
问题 Right now, I have this query: SELECT COUNT(*) AS Count, SUM(Ask) AS Ask, SUM(Cost) AS Cost, Provider, Factura FROM store_items WHERE ( Provider NOT IN(SELECT Provider FROM store_provider_invoices) AND Factura NOT IN(SELECT Factura FROM store_provider_invoices) ) OR Factura NOT IN(SELECT Factura FROM store_provider_invoices) GROUP BY Provider, Factura This is working great, and returns the following array: Array ( [0] => Array ( [Count] => 1 [ID] => 13 [Ask] => 20.00 [Cost] => 10.00 [Provider]

Is it possible to change query after binding a parameter in mysql?

拜拜、爱过 提交于 2019-12-24 13:26:08
问题 For example: if I have this query: SELECT * FROM table WHERE test = ? then I bind a parameter, can I now add something to my query? If this is possible please give me an example in PHP. 回答1: No it isn't possible. What do you need? 回答2: No, it's not possible. You'll have to prepare a new query. 来源: https://stackoverflow.com/questions/31892748/is-it-possible-to-change-query-after-binding-a-parameter-in-mysql

Update query with two post array's

北城余情 提交于 2019-12-24 12:58:43
问题 Making the question clearer from a previous question. I am trying to bring an id from a hidden form on a previous page and using it as a variable as part of an update query. The path to this point is....: Log in to admin area (using a different table)... Search 'businesses' database for entry... Entry displays with an update button, the update button has a hidden ID... value that gets posted to this page through "submit"... if(isset($_POST["submit"]) && isset($_POST["submituname"])) { $id = $

how to remove single quote ' character in mysql text field?

我只是一个虾纸丫 提交于 2019-12-24 12:36:28
问题 This is my query: SELECT count(email_details.id) as total_emails, email_titles.* FROM email_details LEFT JOIN email_titles ON email_details.email_title = email_titles.title GROUP BY email_details.email_title ORDER BY email_titles.id ASC Now my problem is email_details.email_title is blob field and email_titles.title is text field, both field has a data with ’ chracter say "this month’s video" when i runs this query without left join the row having ’ chracter does not retrieve, if i put left

How do I do two MYSQLI queries in one page, what is the best method

天大地大妈咪最大 提交于 2019-12-24 12:19:20
问题 All right. I'm learning about the mysqli API. I've got two files. One that connects to my database, and one that runs the query. Everything works. However, I want to run two queries in a single page. How can I do this? What is a good method to do this? Would the best way be to include my db connect once, then run both queries, and then close my connection to my db once ending it all together? Is that how most people do it? db.php $mysqli = new mysqli("..", "..", "..", ".."); /* check

mysqli_multi_query fails on multiple inserts

别说谁变了你拦得住时间么 提交于 2019-12-24 12:15:10
问题 Greetings, I'm having the following issue: When I attempt to execute several INSERT INTO queries using the mysqli_multi_query function, none of them are executed and I receive a standard "You have an error in your SQL syntax" error, but when I take the exact same string I passed to the function and paste into PHPMyAdmin and execute it, it works flawlessly! Here are the queries I am attempting to execute: INSERT INTO production VALUES( 120, 103, 10, 0, 0 ); INSERT INTO production VALUES( 120,

mysqli_connect Fatal Error: require()

浪尽此生 提交于 2019-12-24 12:14:08
问题 Developing a very simple UPDATE query page for users to change their account password, but have run into a bit of a brick wall with establishing the MySQLi connection (or so it would seem). I'm new to this line of programming and this is my first attempt to perform a dynamic query, so hopefully it's something that one of you can spot easily enough and you'd so kind as to offer some much-needed sage advice. Here's the page in question: http://www.parochialathleticleague.org/accounts.html Upon

MySQLi: Non-English Characters

大城市里の小女人 提交于 2019-12-24 12:09:22
问题 I have a Table named "status" Which is used to store objects status. The table has 5 columns and except "symbol" column which it's type is VARCHAR utf8mb4_unicode_ci, All the others are just typical integers. The problem is that because the symbol column can store English and Non-English characters, It returns NULL(With var_dump($row) ) When I use my php file "getStatus.php" to retrieve the data from a row with Non-English symbol but It works well when I use English characters as symbol. This

MySQLi query vs PHP Array, which is faster?

谁说我不能喝 提交于 2019-12-24 12:05:47
问题 I'm developing an algorithm for intense calculations on multiple huge arrays. Right now I have used PHP arrays to do the job but, it seems slower than what I needed it to be. I was thinking on using MySQLi tables and convert the php arrays into database rows and then start the calculations to solve the speed issue. At the very first step, when I was converting a 20*10 PHP array into 200 rows of database containing zeros, it took a long time. Here is the code: (Basically the following code is