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]: Invalid parameter number: no parameters were
Tag: pdo
Using PDO to CREATE TABLE
I am very new to php and this forum, so please excuse any errors or misplaced questions. In the code i provided, I am just looking to CREATE a Table in the DB “mydb”. I tested the connection to the DB(It works). It is just the creating the table i am having issues with. Any advice or criticisms would be
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 above is just a simplified example of what we
converting to PDO, problems
So I am working on converting an old tutorial I did a while back from mySQL to PDO. This way I can better understand the concepts. I seem to of run into a wall however. The following function is …
Search form with PDO
The below code now works but how can I make it so if no results are found it echos a message instead of blank. I think I’ve managed to create a search query for my database. Its only a very basic …
PDO cannot connect remote mysql server
server A(192.168.1.3) mysql server(5.6.12) port 6603,socket /var/run/mysql/mysql.sock php(5.5.0) php.ini pdo_mysql.default_socket = /var/run/mysql/mysql.sock server B(192.168.1.4) mysql server(5.5….
Causes of MySQL error 2014 Cannot execute queries while other unbuffered queries are active
My server runs CentOS 6.4 with MySQL 5.1.69 installed using yum with CentOS’s repos, and PHP 5.4.16 installed using yum with ius’s repos. Edit3 Upgraded to MySQL Server version: 5.5.31 Distributed by The IUS Community Project, and error still exists. Then changed library to mysqlnd, and seems to eliminate the error. Still, with this back and forth, need to know
Invalid argument supplied for foreach; PDO
I have seen this and this, but neither of these help my situation, this is why I am knowledgeably opening a question that has been asked before. My code is: …
PDO connect to .accdb on network
I have an access database which I would like to CRUD with PDO. When My database is stored on C:\wamp\www\test.accdb I can connect. However, the database I am interested in is stored on our office server, at \server1abc123test.accdb . server1 is mapped to drive z: on my computer. My code looks like this (verbatim) both of these give me error:
PDO fetch / fetchAll
Not new to PHP, but only a day old to PDO. Surely I am doing something wrong here. the only way I can declare those $_SESSIONS properly is if I use $result[0][‘fieldName’]; How can I just access it via $result[‘fieldName’]; ? Answer fetchAll, as the documentation says, retrieves an array of all fetch data simultaneously. Since you are using FETCH_ASSOC,