mysqli

PHP (or MySQL) crash when retrieving a big database record (~5MB)

给你一囗甜甜゛ 提交于 2020-01-03 18:35:15
问题 It doesnt display any errors, just a blank page. I tried die('test') before I call my function to retrieve a record and it does it, but when I place die('test') after my retrieve row function all I get is an empty page (on chrome it says this: Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.) .. I have tried (with 128M, -1, 64M, etc) ini_set('memory_limit', -1); With no luck. I am using mysqli to retrieve the record and a simple query like

Call to a member function bind_param() on a non-object. mysqli [duplicate]

╄→尐↘猪︶ㄣ 提交于 2020-01-03 06:41:28
问题 This question already has answers here : Call to a member function bind_param() on a non-object MySQLi (3 answers) Closed 6 years ago . This is my php code: include ("dbinfo.php"); if(isset($_POST['editsave'])){ $edittitle=$_POST["edittitle"]; $editurl=$_POST["editurl"]; $editdesc=$_POST["editdesc"]; $editid=$_POST["editid"]; $mysqli = $GLOBALS['dbc']; $stmt = $mysqli->prepare("UPDATE links SET title = ?, \desc = ? WHERE id = ?"); $stmt->bind_param('ssd', $_POST['edittitle'], $_POST['editdesc

Proper command order to get num_rows after fetch_array (mysqli OOP)

南笙酒味 提交于 2020-01-03 06:39:15
问题 I'm having a problem getting a num_row when I fetch the results as an array: $sql = "SELECT * FROM people WHERE peopleid=?"; if (!($stmt = $mysqli->prepare($sql))) { echo "stmt Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } if (!$stmt->bind_param("i", $_GET['peopleid'])) { echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error; } if (!$stmt->execute()) { echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error; } $stmt->store_result(); $exist=$stmt->num

script(while-loop) stops and has no ouput when multiple columns are selected

本小妞迷上赌 提交于 2020-01-03 06:32:06
问题 I want to select more than one columns from TABLE but the script is not working once the while loop starts. my php and html code is: <table border="0"> include_once $_SERVER['DOCUMENT_ROOT'].'/include/db.inc.php' ; $sql="select post_title,post_desc,post_date,course,semester,firstname,lastname FROM wbut_forum_posts left join users on post_by = email ORDER BY post_id DESC LIMIT 25"; $result = mysqli_query($link,$sql ); if (!$result) { include_once "wall.html.php"; echo'<tr><td align="center">

mysqli_statement::num_rows() returns the wrong value

∥☆過路亽.° 提交于 2020-01-03 05:46:05
问题 I was writing a database handler class in PHP using the mysqli class and prepared statements. I was attempting to print out the result. It didn't work right off the bat so I decided to do some debugging. I tried to use the num_rows() method from the mysqli_statement class, but it kept returning 0. I decided to write a small portion of test code to keep it simpler so I could see what was going wrong. I was then able to return the data I wanted, but the num_rows() method still returns 0 even

mysqli :: prepare SQL error

非 Y 不嫁゛ 提交于 2020-01-03 05:31:25
问题 Help please :). I'm gettig this error: Warning: mysqli::prepare() [mysqli.prepare]: (42000/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 '?(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id))' at line 1 in ***/classes/db.mysql.class.php on line 69 Warning: mysqli::prepare() [mysqli.prepare]: (42000/1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server

mysqli :: prepare SQL error

这一生的挚爱 提交于 2020-01-03 05:31:09
问题 Help please :). I'm gettig this error: Warning: mysqli::prepare() [mysqli.prepare]: (42000/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 '?(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id))' at line 1 in ***/classes/db.mysql.class.php on line 69 Warning: mysqli::prepare() [mysqli.prepare]: (42000/1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server

how to allow users logged in to UPDATE / EDIT their profile settings/information

自古美人都是妖i 提交于 2020-01-03 05:18:05
问题 Question at hand: How do I create the php code to let users who are logged into my site edit/update their profile settings/information? I have 1 part working correctly for users to change their password, however, have no idea where to start when it comes to allowing users who are logged in to edit/update their other settings such as: (1) nickname, (2) country, (3) date of birth, (4) gender, (5) motto and (6) bio I'll provide the php and html code below that I have that is working for changing

PHP: When add GROUP BY i get error Trying to get property of non-object

穿精又带淫゛_ 提交于 2020-01-03 05:08:14
问题 Hello my code work perfect but when i add GROUP BY i get error, THANKS IN ADVANCE: $sql_query = $connection->query("SELECT * FROM `chat` WHERE `sent_to` = '1'");-Work perfect $sql_query = $connection->query("SELECT * FROM `chat` WHERE `sent_to` = '1' GROUP BY `sent_by`");- Not Work Notice: Trying to get property of non-object Code: $sql_query = $connection->query("SELECT * FROM `chat` WHERE `sent_to` = '1' GROUP BY `sent_by`"); if($sql_query->num_rows > 0) { while ($fetch_data = $sql_query-

mysqli prepared statements with IN operator and one more placeholder

ぐ巨炮叔叔 提交于 2020-01-03 04:36:08
问题 I have some confusion in my code please view my code and suggest me how to pass another parameter in query using with In operator. $cat=1; $lastnames = $ids; $arParams = array(); foreach($lastnames as $key => $value) $arParams[] = &$lastnames[$key]; ; $count_params = count($arParams); $int = str_repeat('i',$count_params); array_unshift($arParams,$int); $q = array_fill(0,$count_params,'?'); $params = implode(',',$q); $qry1=$dblink->prepare("SELECT * FROM course_details WHERE category=$cat and