mysqli

Difference between mysqli and mysql? [duplicate]

99封情书 提交于 2019-12-30 02:27:07
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Advantages Of MySQLi over MySQL I am building a large database and wondered which is the best to use? I am sanitizing my values now and escaping characters for security but I would like to know the different benefits of these mysql querys in php? Thanks. 回答1: Use MySQLi over the older MySQL functions. The "i" stands for "improved". The list of improvements can be found in the docs. 回答2: First of all, you better

I'm a little confused, PHP says $results is a non-object of the mysqli class

十年热恋 提交于 2019-12-29 09:40:11
问题 I'm trying to fetch results using mysqli->fetch_row() (or fetch_object(), fetch_array()), yet when I go to run the code at run time it gives me the following error: Fatal error: Call to a member function fetch_row() on a non-object in...on line 23. The var in question that does this is $results in the code below. $user and $password gain their values from another .php file that this file is being included in so that's not really important at the moment. Now correct me if I'm wrong but if

mysqli : Strict Standards: Only variables should be passed by reference

ぐ巨炮叔叔 提交于 2019-12-29 09:26:07
问题 I'm trying to create a small SQL query class. Here is my Class but i don't why, I've this error : Strict Standards: Only variables should be passed by reference in line 52 Line 52 is : if (!$stmt->bind_param($param[$i][0], mysqli_real_escape_string($this->mysqli, $param[$i][1]))) { My code (i'm beginning) : <?php class Sql{ private $db; private $user; private $pwd; private $url; private $param; private $mysqli; function __construct($db, $user, $pwd, $url){ $this->db = $db; $this->user = $user

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in [duplicate]

a 夏天 提交于 2019-12-29 09:14:14
问题 This question already has an answer here : mysqli_fetch_assoc() expects parameter / Call to a member function bind_param() errors. How to get the actual mysql error and fix it? (1 answer) Closed 7 months ago . I tried to change my mysql to mysqli. And when i do this i get error. I tried everything but i found no solution for this. The error that I have: (what you see is not all the errors) Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\follow\include

Warning: mysqli_select_db() expects parameter 1 to be mysqli, null given

佐手、 提交于 2019-12-29 09:02:28
问题 I keep getting an error message. <?php mysqli_connect("localhost", "root", ""); mysqli_select_db("account"); ?> Here is the error message I get when I try to load it in the browser: Warning: mysqli_select_db() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\MyWebsite\TechanexSiteBase\connect.php on line 4. 回答1: Complete Guide Note : With mysqli you can specify the Database Name in mysqli_connect() You have to use mysqli_connect_error() , not mysqli_error() , to get the error

MYSQLI - WHERE IN array [duplicate]

好久不见. 提交于 2019-12-29 08:26:12
问题 This question already has an answer here : Bind multiple parameters into mysqli query (1 answer) Closed 3 years ago . I've looked all over the internet for answers on this one, and prepared statements and bind params come up (I have no idea what that stuff is) Basically, I have a comma separated list $list = 'food, drink, cooking'; Ok, now I want to search for each of those items in a column of the database... Sounds simple, right? $query = "SELECT * FROM table WHERE stuff IN ('$list')";

Convert mysqli pagination to prepared statement pagination

会有一股神秘感。 提交于 2019-12-29 08:23:28
问题 the current working code with mysqli is as below. I would like to convert it to prepared statements. there is basically three sql query need to convert to prepared statement. the first part is the hardest part for me to figure out the prepared way to get count value which i kinda managed to figure it out eventually. <?php // Script and tutorial written by Adam Khoury @ developphp.com // Line by line explanation : youtube.com/watch?v=T2QFNu_mivw include_once("storescripts/connect_to_mysqli.php

Convert mysqli pagination to prepared statement pagination

半城伤御伤魂 提交于 2019-12-29 08:23:05
问题 the current working code with mysqli is as below. I would like to convert it to prepared statements. there is basically three sql query need to convert to prepared statement. the first part is the hardest part for me to figure out the prepared way to get count value which i kinda managed to figure it out eventually. <?php // Script and tutorial written by Adam Khoury @ developphp.com // Line by line explanation : youtube.com/watch?v=T2QFNu_mivw include_once("storescripts/connect_to_mysqli.php

Warning: mysqli_error() expects exactly 1 parameter, 0 given [duplicate]

笑着哭i 提交于 2019-12-29 08:21:53
问题 This question already has answers here : Warning: mysqli_error() expects exactly 1 parameter, 0 given error [closed] (3 answers) Closed last year . When trying to return a simple set of results from my database table 'checklist' I receive the following error; "Warning: mysqli_error() expects exactly 1 parameter, 0 given" The code of my list.php file is as follows; <?php require_once('/includes/connection.inc.php'); // create database connection $conn = dbConnect('read'); $sql = 'SELECT * FROM

Warning: mysqli_error() expects exactly 1 parameter, 0 given [duplicate]

送分小仙女□ 提交于 2019-12-29 08:21:28
问题 This question already has answers here : Warning: mysqli_error() expects exactly 1 parameter, 0 given error [closed] (3 answers) Closed last year . When trying to return a simple set of results from my database table 'checklist' I receive the following error; "Warning: mysqli_error() expects exactly 1 parameter, 0 given" The code of my list.php file is as follows; <?php require_once('/includes/connection.inc.php'); // create database connection $conn = dbConnect('read'); $sql = 'SELECT * FROM