ddeveloper

ddeveloper supports this item

Supported

31 comments found.

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

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, $pdomodel->where(“user_id”, $array, “IN”); NOT work….

how i can user WHERE IN

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

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 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

Look a this

//$row['Todo_Id'] returns 1,2,3

// works just fine
 $res =  $pdomodel->executeQuery("select * from users where id IN (".$row['Todo_Id'].")");

// dont work

 $pdomodel->where('id',array($row['Todo_Id']),'IN');
 $res =  $pdomodel->select("users");

 $pdomodel->where('id',$row['Todo_Id'],'IN');
 $res =  $pdomodel->select("users");

I have no idea what is wrong

Hi,

As you mentioned

//$row['Todo_Id'] returns 1,2,3

it is not array, it became one single element “1,2,3” so correct code

$data = explode(",". $row['Todo_Id']); $pdomodel->where('id',$data,'IN');

Thanks

I’m trying to loop through the results with :

while($rs = mysql_fetch_assoc($result))

But I’m getting: Warning: mysql_fetch_array() expects parameter 1 to be resource

It’s returning 2 when I use the $pdomodel->totalRows but for some reason I can’t loop the result.

Can you help me?

Hi, it is not showing purchased with your profile. You need to provide purchase code before I can provide support.

Here’s my question again in the right profile:

I’m trying to loop through the results with :

while($rs = mysql_fetch_assoc($result))

But I’m getting: Warning: mysql_fetch_array() expects parameter 1 to be resource

It’s returning 2 when I use the $pdomodel->totalRows but for some reason I can’t loop the result.

Can you help me?

Hi,

The result return is array not mysql result object. It works with PDO and returns data as array format.and you can read array data as any array you read in PHP.

foreach($result as $row){ $user_name = $row[“user_name”];//to get it in variable echo $user_name;//echo variable }

Thanks

Hmmm ok, I got it! Thanks

Hello, I am looking to design a website similar to expireddomains.net. Is your script useful to achieve me that functionality? Let me explain you what exactly I am trying to do. I have a affiliate account with CJ.com and I want to promote GoDaddy domains. GoDaddy offer free list of domains in .csv file which is updated everyday. That csv files contains over 300,000 domains. I am looking to upload .csv file everyday in my website and display in my website with datagrids. (Just like expireddomains.net) do. I would also like advance search and apply search filters to list related to domains. Use the link below to see what type of csv I want to work with… https://www.sendspace.com/file/9ixj3t Also I would like to know how can I apply my affiliate link at CSV file or within your system.

Hi, I have replied to your same message in other thread. Please check. Thanks

mrx02de

mrx02de Purchased

Hi ddeveloper,

is there a way for select distinct. I would like to exclude duplicate results. How does this work with the pagination in a query? Please specify a sample code. Thanks! This is a nice PHP class.

Hi,

For that you need to use execute query function. Please make sure to set $this->backticks = ”” ; (Empty) before using any sql function like select, count etc.

Regarding pagination, you can pass total records generated and current page to generate the pagination code.

Thanks

Pre Purchase Questions. I am wanting to use this specifically for Export as a PDF. Will the export to PDF option automatically run or would end user need to run it?

I need to name the PDF from a fields in database. Is there a way to modify the $fileName so it outputs like below example.

firstname = John lastname = Smith

john_smith.pdf

Thank You

Hi

Not possible with this script. Thanks

by
by
by
by
by
by