I’m using php to insert data from inputs into MySQL database. The problem is, it shows up in phpmyadmin as foreign characters. I’ve already set my database to utf8_hungarian_ci as you can see here: https://i.gyazo.com/aeca91e44e8f1808bad09584d8e938d7.png I’m using utf 8 charset in my form: a…
Tag: mysql
Pagination does not display the last two data from the database
This is where I set the number of pages and starting point: <?php $connection = mysqli_connect("localhost", "root"); $db = mysqli_select_db($connection, 'db_hotelreservation'); …
Roles and permissions in php
I am making a menu, but I want to limit it to only some users with a specific permission can see it. the query: SELECT idpermission,userid FROM user_permissions WHERE userid = “U001” Result: User …
Laravel add calculate the sum where the value is in another table
Basically i have two tables. answers and choices . In my choices table, I got a column choices.value which is has values 0-4. My current query like this $answers = DB::table(‘answers’) …
MySQL Update with 2 conditions
In my table I have some rows with same ‘stock_id’, and need update with 2 conditions, but don’t work, just update all rows with value 1 $this->db->query(‘UPDATE stock_table SET size = IF(kit = …
Problem with binding NULL value to named placeholders with associative array in execute function in PDO
I am trying to construct and execute a delete query when the table_name and the conditional_clauses are passed as parameters in OOP fashion. I am using PDO by wrapping it in a custom wrapper. I am …
How to parse json array from mysql?
I have this data but I can’t parse it in the way I want. this is what I get: { “navigations”: { “title”: “Facebook”, “link”: “https://facebook.com”, “behavior”: “EXTERNAL” } } And …
Queries in multiple loop and Ordering by id of last query
I have two while loops and two queries in the loops. I must order posts as DESC by its IDs. But posts loop is under another query’s loop. $follows=$db->prepare(“SELECT * FROM follows WHERE …
Populating checkboxes from database using PHP – only last option is getting checked
I am trying to populate checkboxes with the data from my mysql database but for some reason only the last checkbox is being checked (for example if automotive, carpentry and hand tools should be …
MySQL (RDS) queries are running in my process list long after my scripts have finished
First up I know something is wrong fundamentally with the way I am running my queries. I would like to ignore the root cause of this and in this question just ask the following: I have a PHP script …