mysqli

PHP登录/注册后台验证实例

老子叫甜甜 提交于 2020-02-05 23:32:12
PHP+MYsql+Ajax实现省市区三级联动和用户注册/登录验证. 项目目录 数据库设计 省市区数据库 用户数据库 数据库信息页面“conn.inc.php” <?php define ( "HOST" , 'localhost' ) ; define ( "USER" , 'root' ) ; define ( "PWD" , 'Aa123123' ) ; define ( "DBNAME" , 'news' ) ; ?> 数据库连接页面“mysqli.php” <?php include 'conn.inc.php' ; $mysqli = new mysqli ( HOST , USER , PWD , DBNAME ) ; if ( $mysqli - > connect_errno ) { die ( '数据库链接出错' . $mysqli - > connect_error ) ; } ?> 账户注册页面“region.php” < ! DOCTYPE html > < html > < head > < title > 用户注册 < / title > < meta http - equiv = "Content-Type" content = "text/html; charset=UTF-8" > < script src = "../jquery/jquery

mysql与mysqli的区别

﹥>﹥吖頭↗ 提交于 2020-02-05 13:58:46
在5.6版本以后,一定要用mysqli代替mysql,否则出错。一些人对错误的解决办法是不对的,只要替代就行了。 来源: CSDN 作者: weimian 链接: https://blog.csdn.net/weimian/article/details/104179914

Attempting to learn mysqli prepared statements; what am I doing wrong?

旧街凉风 提交于 2020-02-05 06:22:02
问题 Here's the error I'm getting... Failed to prepare statement: (1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?.Pages WHERE slug='?'' at line 1 And here's my code... require_once("../database/config.php"); $pageSlug = "home"; $db = new mysqli(_DB_HOST, _DB_USER, _DB_PASSWORD, _DB_NAME); if ( $db->connect_errno ) { echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;

Insert into MySQL from array with mysqli

我只是一个虾纸丫 提交于 2020-02-05 04:19:30
问题 I want to insert some data from a parsed JSON to a table, but when I do it, it doesn't work, it returns 0 rows, what am I missing? I'm new yet with this "mysqli". I have more than 25000 rows to insert to the table. $mysqli = mysqli_connect('localhost', 'root', '', ''); $allData = $dataSource->getAllData(); foreach ($allData as $key => $value) { $query = 'INSERT INTO `table`(`data_id`, `name`) VALUES (' . $value['data_id'] . ', ' . $value['name'] . ')'; $result = mysqli_query($mysqli, $query);

mysqli_result not working converting mysql to mysqli

无人久伴 提交于 2020-02-03 12:02:54
问题 i am converting my old mysql to mysqli but ran into this problem mysqli result does not work.looked on the internet and i founded out that it function had been change,for mysqli result is there a equivalent out here? thank here my error Fatal error: Call to undefined function mysqli_result() in C:\xampp\htdocs\bear_mysqli\functions\users.php on line 153 function user_exists($con,$username) { $username = sanitize($con,$username); $query = mysqli_query($con,"SELECT COUNT(`user_id`)FROM `users`

mysqli_result not working converting mysql to mysqli

时光怂恿深爱的人放手 提交于 2020-02-03 12:00:48
问题 i am converting my old mysql to mysqli but ran into this problem mysqli result does not work.looked on the internet and i founded out that it function had been change,for mysqli result is there a equivalent out here? thank here my error Fatal error: Call to undefined function mysqli_result() in C:\xampp\htdocs\bear_mysqli\functions\users.php on line 153 function user_exists($con,$username) { $username = sanitize($con,$username); $query = mysqli_query($con,"SELECT COUNT(`user_id`)FROM `users`

mysqli_result not working converting mysql to mysqli

杀马特。学长 韩版系。学妹 提交于 2020-02-03 11:59:41
问题 i am converting my old mysql to mysqli but ran into this problem mysqli result does not work.looked on the internet and i founded out that it function had been change,for mysqli result is there a equivalent out here? thank here my error Fatal error: Call to undefined function mysqli_result() in C:\xampp\htdocs\bear_mysqli\functions\users.php on line 153 function user_exists($con,$username) { $username = sanitize($con,$username); $query = mysqli_query($con,"SELECT COUNT(`user_id`)FROM `users`

Why does this SQL UPDATE query not work with a variable for WHERE?

不羁的心 提交于 2020-02-03 02:26:49
问题 this is my first post here at Stack Overflow. I know the question has been asked many times before. I went through many answers, tried all of them (except the correct approach obviously) and don't know what to try anymore. I have an SQL table where every row has an "edit" button. When clicking it, I pass over the id of the selected row to edit.php . There, I get it and update the given row based on the id with the user input from the form. The first column is id which is set to AUTO_INCREMENT

Why does this SQL UPDATE query not work with a variable for WHERE?

安稳与你 提交于 2020-02-03 02:25:06
问题 this is my first post here at Stack Overflow. I know the question has been asked many times before. I went through many answers, tried all of them (except the correct approach obviously) and don't know what to try anymore. I have an SQL table where every row has an "edit" button. When clicking it, I pass over the id of the selected row to edit.php . There, I get it and update the given row based on the id with the user input from the form. The first column is id which is set to AUTO_INCREMENT

Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in C:\User..\ on 148

﹥>﹥吖頭↗ 提交于 2020-01-30 13:25:09
问题 Hello i'm inserting a new column collegename, branch, and gender but suddenly it's giving me this error... Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in C:\Users\Raj\PhpstormProjects\usercake\models \class.newuser.php on line 148 What's that mean? actually i was inserting a new column into my database college , branch , year , and gender everything goes well but when i register myself it's shows the message your