Search found 1803 matches

by johnj
Wed Aug 14, 2013 5:21 am
Forum: PHP coding => General
Topic: how to get the duplicate records from mysql query
Replies: 6
Views: 2060

Re: how to get the duplicate records from mysql query

i think this will also work

Code: Select all

SELECT DISTINCT a.empid FROM `employee` a LEFT JOIN `employee` b ON a.empid = b.empid WHERE a.empid != b.empid;
by johnj
Wed Aug 14, 2013 5:17 am
Forum: PHP coding => General
Topic: how to get the duplicate records from mysql query
Replies: 6
Views: 2060

Re: how to get the duplicate records from mysql query

saramaria is right. We will have to GROUP the records based on a key and then use the HAVING keyword.
by johnj
Tue Aug 13, 2013 4:02 am
Forum: PHP General
Topic: XML Read by XPath DOM
Replies: 14
Views: 3181

Re: XML Read by XPath DOM

that means you did not see this article properly.
by johnj
Tue Aug 13, 2013 2:22 am
Forum: PHP General
Topic: XML Read by XPath DOM
Replies: 14
Views: 3181

Re: XML Read by XPath DOM

by johnj
Tue Aug 13, 2013 12:52 am
Forum: PHP coding => General
Topic: how to get the duplicate records from mysql query
Replies: 6
Views: 2060

Re: how to get the duplicate records from mysql query

Code: Select all

select * from some_table where employee_id = "$emp_id" and week_field = "$week_field"
by johnj
Mon Aug 12, 2013 1:18 am
Forum: PHP coding => General
Topic: How to exclude weekend and holidays
Replies: 0
Views: 832

Re: How to exclude weekend and holidays

something like this: function has_exceeded_30_days($app_date) { // do necessary validations // todays date should be in the same format as that of application date $diff_in_secs = strtotime($todays_date) - strtotime($app_date); $diff_in_days = floor($diff_in_secs/3600/24); if ($diff_in_days > 30) { ...
by johnj
Fri Aug 09, 2013 9:05 pm
Forum: PHP coding => General
Topic: Check username exist in database CI/php
Replies: 1
Views: 1230

Re: Check username exist in database CI/php

1).What do you mean by "not working"?

2).you should post this to the codeigniter forum
by johnj
Fri Aug 09, 2013 8:41 pm
Forum: PHP coding => General
Topic: Example from W3 Schools php and Ajax - should be simple!
Replies: 1
Views: 948

Re: Example from W3 Schools php and Ajax - should be simple!

you have use a different sql for that....something like this....select * from user where firstname LIKE '%peter'. This will fetch all "Peters".
by johnj
Tue Aug 06, 2013 11:33 pm
Forum: mySQL & php coding
Topic: i need help on php mysql
Replies: 8
Views: 3353

Re: i need help on php mysql

What is the problem, what is the error that you are getting?
by johnj
Tue Aug 06, 2013 11:28 pm
Forum: mySQL & php coding
Topic: Arrays of Arrays !!
Replies: 2
Views: 1096

Re: Arrays of Arrays !!

$_POST is an array. So, print this array to see how you are receiving form variables.
do a print_r($_POST)
by johnj
Tue Aug 06, 2013 10:52 pm
Forum: PHP General
Topic: Php variable
Replies: 1
Views: 911

Re: Php variable

$temp1 = bcmul($follow,$followers, 2);
$temp2 = bcmul($temp1,$bytes,2);
$new_variable = bcdiv($temp2,3,0); // change 0 to some other number if you need more precision
echo ' New Variable is: '.$new_variable;
by johnj
Fri Aug 02, 2013 2:20 am
Forum: PHP coding => General
Topic: Deleting duplicates of in a merged multidimensional array
Replies: 0
Views: 843

Re: Deleting duplicates of in a merged multidimensional arra

please read about array_merge, array_merge_recursive and array_combine.
by johnj
Fri Aug 02, 2013 2:15 am
Forum: PHP coding => General
Topic: PHP5 - Infinit loop by WHILE
Replies: 1
Views: 1136

Re: PHP5 - Infinit loop by WHILE

Code: Select all

$i = 0;
$res_Total = mssql_fetch_array(mssql_query($query_Total));
while (count($res_Total) > 0 && $i < count($res_Total))
{
print $Total = $res_Total[0]." - ";
$i = $i + 1;
}  
by johnj
Fri Aug 02, 2013 2:09 am
Forum: PHP coding => General
Topic: strpos always FALSE
Replies: 1
Views: 1277

Re: strpos always FALSE

Please read about strpos and stripos from the php manual on php.net. Then, try a few simple examples.
by johnj
Fri Aug 02, 2013 2:06 am
Forum: PHP coding => General
Topic: exec() function, cmd, background printing
Replies: 28
Views: 17440

Re: exec() function, cmd, background printing

Windows 7 ultimate
by johnj
Wed Jul 31, 2013 5:29 am
Forum: PHP coding => General
Topic: strpos always FALSE
Replies: 1
Views: 1277

Re: strpos always FALSE

srt and str - you have a typo I guess.
by johnj
Tue Jul 30, 2013 9:42 am
Forum: PHP coding => General
Topic: exec() function, cmd, background printing
Replies: 28
Views: 17440

Re: exec() function, cmd, background printing

I downloaded foxitreader and tested what you are doing. I copied a pdf file to my root folder (I used xampp for this test, so it is the htdocs folder) and then used the following code: $ret = exec("C:\\PROGRA~1\\FOXITS~1\\FOXITR~1\\FOXITR~1.EXE /p Prospectus.pdf",$output,$temp); var_dump($output); v...
by johnj
Tue Jul 30, 2013 6:28 am
Forum: PHP General
Topic: How to develop interface between xml and mdb files
Replies: 2
Views: 1120

Re: How to develop interface between xml and mdb files

there are tutorials about how to import xml data to MS Access, please google and read. The time taken will depend on the volume of data.
by johnj
Tue Jul 30, 2013 6:26 am
Forum: PHP coding => General
Topic: PHP AJAX SQL update not working after adding extra record
Replies: 0
Views: 881

Re: PHP AJAX SQL update not working after adding extra recor

are you sure if the table called fullnames has a field called "Condition"?
by johnj
Mon Jul 29, 2013 8:55 am
Forum: PHP General
Topic: File Upload (not selected by user)
Replies: 1
Views: 879

Re: File Upload (not selected by user)

you haven't mentioned clearly how you are downloading the file, initially.

if you do not want to fill the file name then give a default file name, so that the file is autofilled and you can skip the step which requires user selection.
by johnj
Mon Jul 29, 2013 8:47 am
Forum: PHP coding => General
Topic: exec() function, cmd, background printing
Replies: 28
Views: 17440

Re: exec() function, cmd, background printing

for the examples that I gave, you should be using $output, $retcode and $rawoutput. Only then we can see what is happening.
echo '<br>Output is: ';
var_dump($output);
echo '<br/>';
echo 'return code is: ';
var_dump($retcode);
echo '<br> raw output is: ';
var_dump($rawoutput);
by johnj
Mon Jul 29, 2013 8:44 am
Forum: PHP coding => General
Topic: Data/Query Help
Replies: 1
Views: 1022

Re: Data/Query Help

i think if you have the bill id and user name, you can update the bill amount as well as delete the bill.
by johnj
Sun Jul 28, 2013 7:15 am
Forum: PHP coding => General
Topic: exec() function, cmd, background printing
Replies: 28
Views: 17440

Re: exec() function, cmd, background printing

try all these, one at a time. Also, "Brother MFC-7840W" is my local printer name passthru("C:\\PROGRA~2\\FOXITS~1\\FOXITR~1\\FOXITR~1.exe //p C:\\test.pdf"); exec("C:\\PROGRA~2\\FOXITS~1\\FOXITR~1\\FOXITR~1.exe /t C:\\test.pdf 'Brother MFC-7840W'"); exec("C:\\PROGRA~2\\FOXITS~1\\FOXITR~1\\FOXITR~1.e...
by johnj
Sun Jul 28, 2013 4:47 am
Forum: PHP coding => General
Topic: PHP&moreHelp needed from volunteer PROGRAMMER(CharityProject
Replies: 0
Views: 922

Re: PHP&moreHelp needed from volunteer PROGRAMMER(CharityPro

1). too much information
2). lacks direction
3). difficult to expect a free ride for such a big project
by johnj
Sun Jul 28, 2013 4:46 am
Forum: PHP coding => General
Topic: exec() function, cmd, background printing
Replies: 28
Views: 17440

Re: exec() function, cmd, background printing

test.pdf exists on C: drive, so I am not sure what you trying to do.

Anyway, try using passthru instead of exec

Code: Select all

passthru("C:\\PROGRA~2\\FOXITS~1\\FOXITR~1\\FOXITR~1.exe /p C:\\test.pdf");