I have written a function that takes four arguments and passes them to my MySQL database using a PDO. I am trying to use bindParam so that I can use the variables to construct the query. I have followed the examples in the PHP documentation, but I am getting the following error: ERROR: SQLSTATE[HY093]: Invali…
Tag: mysql
How to set a collation with mysqli?
My database uses utf8_czech_ci collation and I want to set it to my database connection too. Mysqli_set_charset won’t let me set collation, if I don’t happen to want the default one, utf8_general_ci. Here was suggested first to set the charset through mysqli_set_charset and then to set collation b…
“Delete row” button for MySQL in PHP
I have a table that becomes populated with data from a MySQL database, and each row receives its own delete button. I would like to have the option to delete each row separately with a delete button that deletes the corresponding row in the database. How would I go about doing so? Here’s the part of the…
MySQL GROUP_CONCAT with COLUMN SPLIT
I am working with a TABLE, need logical help. Check the below URL for the table structure and sample data. http://sqlfiddle.com/#!2/ece06/2 Table Schema: Inserted Data: Query: OutPUT: Expected OUTPUT: As you can see the output of the query has concat with comma. And currently we are doing string concat using …
Symfony/Doctrine Rearranging Database Columns
When I go to generate a table using the doctrine:schema:update command line, it appears that Doctrine(or Symfony?) wants to throw in a command that rearranges my columns, putting the keys towards the front it would appear. I was wondering if, and more hopefully, where, I can disable this “feature”…
get two paths of images from database and loop them to display in slider
Im little bit stuck on a logic.scenario is i have a slider where two images are shown at a time taking 50%-50% part of screen,here is the simple html of it,
Best practice multi language website
I’ve been struggling with this question for quite some months now, but I haven’t been in a situation that I needed to explore all possible options before. Right now, I feel like it’s time to get to know the possibilities and create my own personal preference to use in my upcoming projects. L…
Job exporting tables to file every 15 minutes and calling PHP script once done
I’ve been doing a lot of researching for a potential job where I will need to periodically (every 15 minutes) export some specific data from SAP and then import that data into a mySQL database on a …
MySQL syntax ERROR, I simply don’t see where
I am having a syntax error with an sql statement I am executing but for the life of me I can’t find any error. I have created my own database class with functionality to make prepared statements and execute them, I don’t think there is a problem with my implementation as I have never had any issue…
Escape raw SQL queries in Laravel 4
How does one go about escaping parameters passed to a raw query in Laravel 4? I expected something like DB::escape() (which rings a bell from Laravel 3) and also attempted DB::quote() (which I thought could be available through the PDO object) We can’t use the select method with placeholders as the abov…