PHP Like System / 'Most Liked' (Need for logic)

I'am trying create a basic comment system, I was success but I have a problem right now. I can't list "most liked" comments and I don't have an idea about how can I. My votes database showing like that: voteid | value | entryid | userid 25 ...
more »

2017-02-22 21:02 (1) Answers

Multiple insert query error while using PHP - PDO

This is a test query "INSERT INTO `tablename` (`col1`,`col2`) VALUES ('1487767957','1470061061'),('1487767957','1470119999'),('1487767957','1478802807')"; "INSERT INTO tablename (col1,col2) VALUES (1487767957,1470061061),(1487767957,1470119999),(14...
more »

2017-02-22 17:02 (0) Answers

CakePHP 3 ODBC connection

Using Windev our databases are currently hosted on HFSQL, the proprietary Windev database system. I would like to use CakePHP to allow a web view of the data. I know how to connect to the HFSQL database via ODBC and it works in php, but impossible ...
more »

2017-02-22 16:02 (0) Answers

Enable PDO Oracle

I want to enable PDO for Oracle. I try uncomment the following line in php.ini to enable it but it's not working: extension=php_pdo_oci.dll PHP Description: Version:5.6.15 Thread Safe VC11 I install Oracle Database Express Edition 11g Releas...
more »

2017-02-22 12:02 (0) Answers

Pagination in php mvc(jream)

sometimes last year i went through a php mvc tutorial done by jream the platform looks so simple and convenient. Now am building a web application with this mvc platform and now am stoked in the aspect of pagination, while trying to paginate records ...
more »

2017-02-22 09:02 (0) Answers

Can't get it to sort properly... PHP PDO

Trying to create a search function for a car dealer where the inventory listings are narrowed down by year, make, model and price range. For some reason I can't get the price options to work. I want to set it up so that the prices are listed in rang...
more »

2017-02-22 04:02 (0) Answers

PDO statement not inserting into database

Hello I have this code that won't work. I've been bugging with it for about an hour and can't seem to find any errors, I don't know what it is. Maybe someone could help me here. Inserting script : <?php error_reporting(E_ALL); ini_set('d...
more »

2017-02-22 00:02 (2) Answers

How to SELECT from database with pdo

When I try to execute this code, the site goes offline. Can you help me fix the code, since I cannot get it to work? :( I have managed to set up update and insert queries. Get.php case "callfromotherfile": $getcat = new Test(); ech...
more »

2017-02-21 20:02 (1) Answers

pdo bindParam with associative array

I am trying to bindParams with an associative array, looped through a foreach, but I dont get it to work somehow. I am getting this error: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens here...
more »

2017-02-21 12:02 (2) Answers

Insert syntax and image uploading in PHP

The image uploading in my scripts doesn't works. However, if the variable ($imgName) is null, the query should still works because the image column in my phpmyadmin is can be default to NULL and the NULL checkbox is checked. So, my codes should still...
more »

2017-02-21 11:02 (0) Answers

Invalid parameter number for PDO statement

Next code gives me an error SQLSTATE[HY093]: Invalid parameter number $sql = "INSERT INTO `users` (`id`, `date_install`, `date_ping`, `cc`, `uv`, `pid`, `pv`, `aff_id`, `sub_id`, `channel`, `cid`, `os`, `av`, `db`) VALUES (:id, :date_install, now(),...
more »

2017-02-21 10:02 (3) Answers

Yii2 oracle 11g gii relations timeout

I have: Windows Server 2012 R2 wampserver 3.0.6 64bit yii2 php_oci8_12c enabled, php_pdo_oci enabled, oracle instantclient-basiclite-windows.x64- System Path defined according added mod_fcgid 2.3.9 to Apache added oci8 2.0.12 Thread Safe ...
more »

2017-02-21 09:02 (0) Answers

Set Database Row Order

I am wanting to make a list of database results on my website. The max number of results that will come back is 5, and I want the user to be able to chose the order in which they are displayed. To do this, I have an "order" column in my database tabl...
more »

2017-02-21 01:02 (1) Answers

No polish characters PDO MysQL

I have no idea, what is going wrong. There is a connection with database, and it inserts but without polish characters. What I do wrong? $conn = new PDO("mysql:host=$host;dbname=$database;charset=utf8", $user, $pass); also does not work... <...
more »

2017-02-20 20:02 (0) Answers

Take ID after database insertion / MySQL / PHP

I want to take the ID of a row just after its creation. Im using PDO. Here is my code: $insertNewIndividualConv = $bdd->prepare('INSERT INTO conv_individual(user1, user2, created) VALUES(:user1, :user2, :created)'); $insertNewIndividualConv -&g...
more »

2017-02-20 17:02 (0) Answers

Is there a PDOStatement "executed" flag?

Is there such a thing like an "executed" flag for PDOStatement (PDOStatement) to see if the statement has been executed (by calling PDOStatement::execute())? Or am I forced to just set my own flag? Judging by the documentation, there doesn't seem to...
more »

2017-02-20 14:02 (2) Answers

Cant connect to MySQL with PDO

I have a class which communicates with MySQL database. This class have method which creates PDO object - getDB and two methods which calls getDB and then inserts something into DB. I call the insertNewUser and insertArticle from different instances ...
more »

2017-02-20 14:02 (0) Answers

Query not executing, insert data in MySQL PDO

I want to insert some data to MYSQL database. I am using MultiPartUploadRequest library to to that. There are no errors, but data is not inserted. I have no idea how to solve it. Any ideas? I am new to PHP, so I do not know, if it is a good solutio...
more »

2017-02-20 13:02 (0) Answers

Using MySQLi together with PDO?

Hie, Is it possible to have a registration page that uses PDO and the rest of other pages of my application use MySQLi?I have read that PDO is good technology as opposed to MySQLi so i would like to learn it gradually. ...
more »

2017-02-20 09:02 (1) Answers

PDO MySQL where condition if null or equal

I have a products table which has types_id, mid_types_id and sub_types_id. sub_types_id can be null. My query like this : public function getProductsByType($types_id, $mid_types_id, $sub_types_id, $limit, $offset) { $sql = "SELECT * FROM p...
more »

2017-02-18 16:02 (2) Answers

PHP PDO - I can't update the variables

I am trying to do a admin panel. I used PDO for database connect. In panel, i want to update site title, site url etc. But i have a problem. I am sure that i did all true. I need your help. This is admin panel code : <?php include 'config....
more »

2017-02-18 15:02 (1) Answers