mysqli

mysqli php table names with hyphen or space

青春壹個敷衍的年華 提交于 2020-01-16 11:51:31
问题 The website is intended to display certain laws/rules by jurisdiction. There is a simple mysqli query that finds the counties and then displays the county names on screen with this: echo "><a href=\"index.php?sel_subj=" . urlencode($subject["county_name"]) . "\"> {$subject["county_name"]}</a></li>"; Then you click on a county name (embedded with the link) and a mysqli query is supposed to look up a table with that county name and get all the jurisdictions within that county. if (isset($_GET[

Insert data from datepicker in database using php

邮差的信 提交于 2020-01-15 23:58:53
问题 I have a problem and I can't resolve it, So my script: <script> $(document).ready(function() { $("#datepicker").datepicker({ format: 'dd-mm-yy' }); }) My html: <div class="form-group"> <label>Date:</label> <input class="form-control marg-left-10" name="date" type="text" id="datepicker"> </div> My php: $date = date('dd-mm-yy', strtotime($this->input->post['date'])); But the date doesn't insert, in my database the date look like this : 0000-00-00 Help me please 回答1: Use the appropriate format /

MYSQL: Vacant / occupied rooms as now

限于喜欢 提交于 2020-01-15 13:39:19
问题 I have three tables room_charges, room_category and patient_detail room_category id room_category 1 twin 2 classic 3 Deluxe room_charges id room_name room_category 1 tw1 1 2 tw2 1 3 cl1 2 4 cl2 2 5 dl1 3 patient_detail id patient_name room_name room_category admission_date_time discharge_date_time discharged 1 Mr x 1 1 10-12-14 10:40 12-12-14 08:40 1 2 Mr y 1 1 12-12-14 11:40 15-12-14 13:10 1 3 mr z 1 1 15-12-14 14:40 null null I am using the query to find the vacant_beds detail, but as per

MYSQL: Vacant / occupied rooms as now

↘锁芯ラ 提交于 2020-01-15 13:39:06
问题 I have three tables room_charges, room_category and patient_detail room_category id room_category 1 twin 2 classic 3 Deluxe room_charges id room_name room_category 1 tw1 1 2 tw2 1 3 cl1 2 4 cl2 2 5 dl1 3 patient_detail id patient_name room_name room_category admission_date_time discharge_date_time discharged 1 Mr x 1 1 10-12-14 10:40 12-12-14 08:40 1 2 Mr y 1 1 12-12-14 11:40 15-12-14 13:10 1 3 mr z 1 1 15-12-14 14:40 null null I am using the query to find the vacant_beds detail, but as per

MYSQL: Vacant / occupied rooms as now

柔情痞子 提交于 2020-01-15 13:38:48
问题 I have three tables room_charges, room_category and patient_detail room_category id room_category 1 twin 2 classic 3 Deluxe room_charges id room_name room_category 1 tw1 1 2 tw2 1 3 cl1 2 4 cl2 2 5 dl1 3 patient_detail id patient_name room_name room_category admission_date_time discharge_date_time discharged 1 Mr x 1 1 10-12-14 10:40 12-12-14 08:40 1 2 Mr y 1 1 12-12-14 11:40 15-12-14 13:10 1 3 mr z 1 1 15-12-14 14:40 null null I am using the query to find the vacant_beds detail, but as per

What exactly does first parameter in bind_param() do?

吃可爱长大的小学妹 提交于 2020-01-15 09:27:49
问题 I am trying to understand prepared statements using PHP and mysqli. I tried to read on some tutorials, manual and this one: Bind_Param in PHP, but I have not yet found any satisfying answer. Someone wrote in answer as: When you prepare an SQL statement, you can insert a placeholder (?) where a column value would go, then use bind_param() to safely substitute that placeholder for the real column's value. This prevents any possibility of an SQL injection. I found some code in tutorials like

What exactly does first parameter in bind_param() do?

寵の児 提交于 2020-01-15 09:27:09
问题 I am trying to understand prepared statements using PHP and mysqli. I tried to read on some tutorials, manual and this one: Bind_Param in PHP, but I have not yet found any satisfying answer. Someone wrote in answer as: When you prepare an SQL statement, you can insert a placeholder (?) where a column value would go, then use bind_param() to safely substitute that placeholder for the real column's value. This prevents any possibility of an SQL injection. I found some code in tutorials like

mysqli_result::free increase php memory usage

元气小坏坏 提交于 2020-01-15 07:18:08
问题 Sometimes memory_get_usage() return a bigger value after using free() . See the example below: $query = "SELECT * FROM table"; $result = self::query($query); while ($row = $result->fetch_assoc()) { $myArray[] = $row; } echo "Before: ".number_format(memory_get_usage()); $result->free(); echo "After: ".number_format(memory_get_usage()); The output is: Before: 1,203,856 After: 1,370,976 But if I comment the instruction in the loop then the memory usage decrease after the free() : $result = self:

mysqli_result::free increase php memory usage

一曲冷凌霜 提交于 2020-01-15 07:17:11
问题 Sometimes memory_get_usage() return a bigger value after using free() . See the example below: $query = "SELECT * FROM table"; $result = self::query($query); while ($row = $result->fetch_assoc()) { $myArray[] = $row; } echo "Before: ".number_format(memory_get_usage()); $result->free(); echo "After: ".number_format(memory_get_usage()); The output is: Before: 1,203,856 After: 1,370,976 But if I comment the instruction in the loop then the memory usage decrease after the free() : $result = self:

Move data from one table with button to another table Laravel

筅森魡賤 提交于 2020-01-15 05:25:07
问题 Before someone say this is a duplicate. Yes i have found this: Move data from one MySQL table to another But in Laravel its a bit different this is quiet that what i want. Like him i want a button wich delete a row in a tabel like this one: (Updated picture) Just to have an example. After he hit the button it should move the shown row into the database just like it is shown here and delete it afterwards. I really dont know how to start something like this in laravel and i really cant find