125 comments found.
Hi how i can use SUM ?? about the WHERE IN i have send you a email, but you still dont answer me. thanks
Hi,
I haven’t received your email. Please send me again using my profile. I will reply you immediately. Thanks
i sent again, waiting for your answer
Hi, I have replied to your email. Please check. Thanks
Dude, or i m crazy or it have alot of errors.
$pdomodel->where("Post_Id",$id,'<>');
$pdomodel->where("Post_Status",0);
$pdomodel->openBrackets = "(";
$pdomodel->where('Post_Cat',1);
$pdomodel->andOrOperator = "OR";
$pdomodel->where('Post_Cat',2);
$pdomodel->closedBrackets = ")";
$pdomodel->orderByCols = array("rand()");
$pdomodel->limit = "0,1";
$result = $pdomodel->select("posts");
this code was supost to return
Select * from posts where Post_Id <> ? AND Post_Status = 0 AND (Post_Cat = 1 OR Post_Cat = 2)
But this return
Select * from posts where Post_Id <> ? OR Post_Status = 0 OR (Post_Cat = 1 OR Post_Cat = 2)
What i m doing wrong?
hi,
I have used same code as you have sent me and it is generating me proper query
SELECT * FROM `posts` WHERE `Post_Id`<> ? AND `Post_Status`= ? AND ( `Post_Cat`= ? OR `Post_Cat`= ? ) ORDER BY `rand()` LIMIT 0,1
I think you have set the default value of andOrOperator = “or”. Please check
andOrOperator ="or"
instead of the
andOrOperator ="and"
Please check.
i never have set the default operator. if you plan a update maybe create
$pdomodel->where(x=y); $pdomodel->and_where(x>y); $pdomodel->or_where(x<y);
select from aaa where x=y and x>y or x<y;
It has this functionality but it is done in another way. using the andoroperation setting. Thanks
Hi, $pdomodel->where(“user_id”, $array, “IN”); NOT work….
how i can user WHERE IN
thanks
Hi
Please check following example in demo folder.
$pdomodel->where(“empId”, array(30,50), “IN”);
It works.
Thanks
Dont works for me
first, the query return like this select * from post where empIDIN – the IN gets together with the empID so i used to put a space ” IN” but still wont work for me, can you check with a big array?
Also check with a big array
Hi, I have checked it is working fine at my end. Please contact via profile. I will send you my copy of file again. Thanks
AGAIN, how order by rand () – i m still waiting for this answer – thanks.
Hi, for order by rand() to work, a small change will be required. You need to set backtick = ”” in the PDOModel.php file.I can send you file after required change if you want. Thanks
Hi!
I need to know how to close and reset all the database connections. Thanls!
Hi,
There is no connection close method in PDO. It is not required unless you explicitly want to do same. To do, just set your PDO object to false.
Please refer below stackoverflow question for more details.
http://stackoverflow.com/questions/15444748/is-it-necessary-to-close-pdo-connections
array(1) { [0]=> array(3) { ["Id"]=> string(1) "1" ["Status"]=> NULL ["User"]=> string(4) "name"}
echo $result[0]['User'] ; // cant be $result['User']
what else i need to do?
Hi,
Select query return result as array. You can loop array using foreach.
Here is example of running select query on a table
//Example 1 $result = $pdomodel->select(“users”);//run select query
foreach($result as $row){ $user_name = $row[“user_name”];//to get it in variable echo $user_name;//echo variable }
//Example 2 //if you want to run query directly $sql = “select * from tablename”; $result = $pdomodel->executeQuery(sql); //run select query
foreach($result as $row){ $user_name = $row[“user_name”];//to get it in variable echo $user_name;//echo variable }
Please let me know if you need any more information from my side. Thanks
I get the select only as arrays. What do i need to do, to get string and put variables in echo. The Documentation is very vague about that.
Hi, when you run select query, it returns multiple rows of data. That data is returned in form of array. You can echo $row0.
Let me know if you need further explanation. Thanks
Well, i get an Undefined variable: row error. Normaly if i write pdo myself i do it this way:
$sql = “SELECT * FROM XXX”; foreach($pdo->query($sql) as $row){ $xxx = $row[‘xxx’];
and then i can output $xxx as echo
How do i do this with the script?
I think, You haven’t read the documentation. There is no query function that you are using here.
Please check this
http://demo.digitaldreamstech.com/PDOModel/documentation/pdo/execute-query.php (For executing query)Thanks
I think you havent read my comment correctly. The query was an example from my own code. All i wanted to know was what command i need to use to use query in your script.
The Tipps from you: executeQuery and $row0 just show 1 specific row. But i want to show all entries. Therefore my example with foreach ….
Well i thought this script would save me time, but the documentary and the support is bad.
You have not read the example I have send you and given rating. Do you know how much effort as a developer we put to make this script and without even thinking you have given rating.
For each things, examples are given and documentation for each function is written there. I request you to give proper rating. If you want, i am ready to give refund but don’t say that documentation is not enough.
Well then give me a working example, how my own independent code:
$sql = “SELECT * FROM XXX”;
foreach($pdo->query($sql) as $row) {
$xxx = $row[‘xxx’];
}
translates to the Syntax from your code.
And yes i have read the Documentation, but in my eyes the examples are not covering my question.
Here is example of running select query on a table
//Example 1 $result = $pdomodel->select(“users”);//run select query
foreach($result as $row){ $user_name = $row[“user_name”];//to get it in variable echo $user_name;//echo variable }
//Example 2 //if you want to run query directly $sql = “select * from tablename”; $result = $pdomodel->executeQuery(sql); //run select query
foreach($result as $row){ $user_name = $row[“user_name”];//to get it in variable echo $user_name;//echo variable }
Let me know.
Let me know if this is what you are looking for else contact me for more details.
Hi, have you checked? Can you provide me now proper rating? Thanks
Youn piss me off. I already changed rating to 5. But because you annoy me i change it again.
I am really sorry but I didn’t got any message(email) for rating that’s why I have asked. Please change it. I will not send you any message further. Thanks a lot
How to order by ascending and descending?
$pdomodel->orderByCols = array(“firstName”); // asc
$pdomodel->orderByCols = array(“firstName desc”);// desc
http://demo.digitaldreamstech.com/PDOModel/documentation/pdo/select.phpThanks
I like this.When a new version?
Hi, Thanks
Please specify feature you want to see in new version. I will try to add that. Thanks
I love this! I am wondering if this is possible: When the select query returns only a single result, only return a 1-dimensional array with that row as the data, instead of a 2-dimensional array, this way I don’t need a foreach statement for just one row of data.
Hi, Ok..I will add this option in next version. Thanks 
i want to search data by criteria in 8 fieldname simultaneously on the same tabe. below is the details. cenglish, cmathematics, cinscience,cstudies (Should filter between A-C ) egrade1,egrade2,egrade3,egrade4 (Should filter between A-D ) all in one query
You can create by adding multiple where clause with and and or operator. I am not able to see any purchase information with your account. Have you purchased it?
Hi dev, can i ask how can I increase the font size of excel output? also, is it possible to insert image, or better if it can support graphs? thanks 
Hi, this script pass data to generate output in excel but to format excel data, you need to use some extra code. It is not possible with this script. Thanks
hi, just want to ask. how secure is your class? i.e. from sql injection? btw, this is really very helpful on my projects.
Hi, all queries are executed using parameter binding and prepared statement with PDO. It is sufficient to prevent sql injection. You can read more here
http://stackoverflow.com/questions/134099/are-pdo-prepared-statements-sufficient-to-prevent-sql-injectionThanks
Can you show me how to query results from DB using this script ?
I can’t figure out how to retrieve records from the various “select” query examples
Here is one that works for me but I can’t figure out how to retrieve the records
$pdomodel->joinTables(“work_thumbnail”, “posts.id = work_thumbnail.project_id”,”INNER JOIN”);//specify join
$records = $pdomodel->executeQuery(“select * from `posts`”);
Hi,
http://demo.digitaldreamstech.com/PDOModel/documentation/pdo/join.php http://demo.digitaldreamstech.com/PDOModel/documentation/pdo/select.phpPlease check example and more example for performing join and select operations.
Let me know if you have any further doubt. Thanks
Did you receive my email with code? I would appreciate your resolution of this matter. Thanks.
Yes, I received your code. I am checking it.
Any update please?
I have replied to you on your email as you contacted also via profile.
There is a way to “associate” column in csv/xls import into fields database using the new import csv/xls function? Thanks
If your csv column_name are same as the db column name then yes, they can be associated directly.
Thanks for answer, have 3 more questions related to CSV/XLS import if the column names are different, how can be associated? is possible to import only some columns from CSV/XLS? can also make “operations” to imported CSV/XLS columns before add them into DB? Is possible to add other data (“fixed” data, or calculated fields) into DB when i make a CSV/XLS import?
Thanks
It provides data in format of array that can be modified to import data in appropriate field and do required calculation before insertion of data.
Hi, When is version 1.2 ready for us?
On 11th, we will upload version 1.2. Thanks
is the update ready?
Yes
when soonest can we have a copy for the fresh update?
Hi
Sorry for my question but wonder if your script’s output is in a table form and if it is has it got pagination as well?
thanks
Script default output is in array format and there is pagination function also present as a helper, using both function, you can easily create complete pagination with html table.
May be in next version, I will add this feature also.
Hi. I have a problem with the export to Excel.
I am getting the error messageFatal error: Uncaught exception ‘PHPExcel_Writer_Exception’ with message ‘Could not close zip file php://output.’
Hi, I have checked. Most common cause for this error is because the folder is not present or you don’t have sufficient permission. Please check and provide proper access. Thanks
Can you kinfly let me know what folder I need which I will create and whether it is relative to the class file or template used. Thanks!
Please give read and write access of the folder name “saved”, it is at the same location as script folder is. Thanks
Thanks. This is the error I am getting: Your help is greatly appreciated. Fatal error: Uncaught exception ‘PHPExcel_Writer_Exception’ with message ‘Could not close zip file php://output.’ in C:\inetpub\wwwroot\dealsmaster\reporting\includes\library\PHPExcel\PHPExcel\Writer\Excel2007.php:348 Stack trace: #0 C:\inetpub\wwwroot\dealsmaster\reporting\includes\PDOModel.php(1168): PHPExcel_Writer_Excel2007->save(‘php://output’) #1 C:\inetpub\wwwroot\dealsmaster\reporting\report_deliverynotes_declined3.php(17): PDOModel->arrayToExcel(Array, ‘Deals_2016-04-0…’) #2 {main} thrown in C:\inetpub\wwwroot\dealsmaster\reporting\includes\library\PHPExcel\PHPExcel\Writer\Excel2007.php on line 348
Yes, I know that and as I explained it is because of the folder don’t have access permission. Do one thing, contact me via my profile so that I will receive your email Id and we can do it faster. Thanks
I will do, but I am waiting for confirmation that the folder has the access. Incidentally I copied over the contents of the script directory which does not have the saved directory in it, so for future updates you may wish to include this. Apart from this glitch – which is not your fault – this is an excellent script. I have just rated it 5 stars.
Also as a thought for future versions it would be great if one could pass a chosen directory for saving.
Thanks a lot for your great feedback. This motivates a lot to add new feature. Version 1.2 with many more features will be uploaded for review on 11th, I will try to add that feature also in version 1.2. Many Thanks
I want to say publically thanks to the developer who has stuck by me with a problem (more mine!) and sorted it. His support has been great.
Thanks a lot for your nice words, always happy to help !!!
Hi,
I trust you are doing well. sadly i am still not able to perform the following operation:
orderBy($columns, $order = “ASC”)
Or maybe there is no such feature? In the end i want to perform this kind of query:
$query = $pdomodel->displayError(TRUE)>selectColumns($array)>setLimit(“0,1”)>where($field, $value)>orderBy($columns, $order = “ASC”)->select($table);
Thanks, waiting for your reply.
Right now, orderBy is done like $pdoobj->orderBy = array(“colname asc”), The chaining feature you are asking is mostly completed and will be released with version 1.2 in few days. We are doing testing of these features. I will update you once we release version 1.2 with many more features.
Hi,
Thanks for the response. What do you think of changing this : $pdoobj->orderBy = array(“colname asc”) to this $pdoobj->setOrderBy->(array(“colname asc”));
Thanks.
Hi, its already done in version 1.2 as I informed you. I will let update you once version 1.2 is ready to be release. Thanks