Search found 653 matches

by chorn
Sun Jul 22, 2018 9:43 pm
Forum: PHP coding => General
Topic: Passing variable value from one if statement to another
Replies: 1
Views: 556

Re: Passing variable value from one if statement to another

why do you think $var is not available later?
by chorn
Sat Jul 21, 2018 12:33 pm
Forum: PHP coding => General
Topic: sending data from one page to other
Replies: 3
Views: 794

Re: sending data from one page to other

Use a form, like <form>, set method-attribute, like method="post".
by chorn
Thu Jun 28, 2018 4:57 am
Forum: PHP coding => General
Topic: which one is better, PHP or Nodejs
Replies: 2
Views: 651

Re: which one is better, PHP or Nodejs

for what.
by chorn
Sun Jun 24, 2018 9:47 pm
Forum: PHP coding => General
Topic: Multidimensional array
Replies: 3
Views: 994

Re: Multidimensional array

The first one is just the text representation from print_r(). The second is the php-source-code equivalent to get there.
by chorn
Thu Jun 21, 2018 9:16 pm
Forum: mySQL & php coding
Topic: Breif query about reading from PDO
Replies: 3
Views: 1946

Re: Breif query about reading from PDO

what function.

use $conn->fetchAll().
by chorn
Thu Jun 21, 2018 9:13 pm
Forum: PHP coding => General
Topic: Code Editor
Replies: 2
Views: 778

Re: Code Editor

Just try out some editors (notepad++, phpstorm), at least it's your preference, and even notepad (on windows) can be a 'good' [enough] editor if it's the only one you are allowed to use, but other tools will give you way more help and faster results.
by chorn
Tue Jun 19, 2018 12:02 am
Forum: PHP General
Topic: How to build a simple calendar, timetable.
Replies: 1
Views: 640

Re: How to build a simple calendar, timetable.

If you want the calendar to be clickable, use some javascript, have a look at "jquery ui datepicker" for some input. You can also just build a list of dates with the DateInterval and DatePeriod classes from within PHP and provide clickable links in plain HTML.
by chorn
Mon Jun 18, 2018 9:37 pm
Forum: PHP coding => General
Topic: RewriteRule
Replies: 4
Views: 911

Re: RewriteRule

your rewrite rule is missing the terminator at the end.
by chorn
Mon Jun 18, 2018 9:29 pm
Forum: PHP coding => General
Topic: append every n lines in a file PHP
Replies: 1
Views: 669

Re: append every n lines in a file PHP

while walking over the data you can check every key with the modulo operator.
by chorn
Sun Jun 17, 2018 9:39 pm
Forum: PHP coding => General
Topic: RewriteRule
Replies: 4
Views: 911

Re: RewriteRule

Did you really not even try anything like just removing the parts you do not want to match within the URL?
by chorn
Fri Jun 15, 2018 10:21 am
Forum: PHP coding => General
Topic: create multiple instances of a script
Replies: 2
Views: 810

Re: create multiple instances of a script

You can run every file over CLI via `php -f file.php`, or use thread with e.g. pthreads.
by chorn
Wed Jun 06, 2018 9:37 pm
Forum: PHP coding => General
Topic: Insert php inside double quotes
Replies: 2
Views: 939

Re: Insert php inside double quotes

Only variables are interpreted within double-quotes - php code is not. And fopen requires just a filename, like "phpwtf.txt", that may be hold within a string, but also filesystem restrictions apply (e.g. no slashes, except for if you want to create a directory).
by chorn
Sat Jun 02, 2018 5:00 am
Forum: PHP General
Topic: Shipment Tracking
Replies: 1
Views: 838

Re: Shipment Tracking

Get an HTML form, receive the value within a PHP script and make a query to your shipments-database.
by chorn
Wed May 30, 2018 8:06 am
Forum: PHP coding => General
Topic: Encrypt Query
Replies: 1
Views: 676

Re: Encrypt Query

libsodium.
by chorn
Mon May 28, 2018 12:02 am
Forum: PHP coding => General
Topic: Modals from PHP
Replies: 1
Views: 668

Re: Modals from PHP

You can use websockets for bi-directional communication, but i wonder what script should message the client after it was done...
by chorn
Sun May 27, 2018 5:51 am
Forum: PHP coding => General
Topic: Alogo to password_needs_rehash
Replies: 5
Views: 1047

Re: Alogo to password_needs_rehash

the manual says something else.
by chorn
Wed May 23, 2018 10:52 pm
Forum: PHP coding => General
Topic: custom wordpress plugin code
Replies: 3
Views: 898

Re: custom wordpress plugin code

There are alreadysolutions for it, just search for "jquery datepicker disable sundays".
by chorn
Wed May 23, 2018 9:14 am
Forum: PHP coding => General
Topic: Inserting NULL into date Field
Replies: 3
Views: 830

Re: Inserting NULL into date Field

I would recommend to first fix the SQL statement before testing around with any value. But still: if you want to insert a NULL value, the quotes must be removed. Better use Prepared Statements, e.g. with PDO, so the quotes are added automatically only when necessary.
by chorn
Wed May 23, 2018 5:47 am
Forum: PHP coding => General
Topic: Inserting NULL into date Field
Replies: 3
Views: 830

Re: Inserting NULL into date Field

Why do you try to insert $rowData when you cast to $dateValue first? The variable wouldn't be interpreted within single quotes. Also a NULL value must be inserted without quotes, or it's taken as a string. You should read the section about quotes again: http://php.net/manual/en/language.types.string...
by chorn
Tue May 22, 2018 11:17 pm
Forum: PHP coding => General
Topic: Grouping By returns first record
Replies: 5
Views: 1026

Re: Grouping By returns first record

EVERY (!) column that is not in the group by clause must be aggrgated, you can't write "select *" here.
by chorn
Tue May 22, 2018 3:20 am
Forum: PHP coding => General
Topic: Grouping By returns first record
Replies: 5
Views: 1026

Re: Grouping By returns first record

Every column that is not in the GROUP BY clause must be aggregated, with e.g. SUM, AVG, MIN, MAX,, or whatever you think might be suitable. Otherwise you get random results. More sophisticated databases would give you an error, MySQL just gives you fucked up results.
by chorn
Mon May 21, 2018 9:56 am
Forum: PHP coding => General
Topic: Alogo to password_needs_rehash
Replies: 5
Views: 1047

Re: Alogo to password_needs_rehash

Provide a different algo to password_hash().
by chorn
Sun May 20, 2018 10:08 pm
Forum: PHP coding => General
Topic: Alogo to password_needs_rehash
Replies: 5
Views: 1047

Re: Alogo to password_needs_rehash

Just like the manual says: A hash created by password_hash().
by chorn
Sun May 20, 2018 10:07 pm
Forum: PHP coding => General
Topic: extracting data from xml into custom array
Replies: 2
Views: 745

Re: extracting data from xml into custom array

Use XPATH to get the node, then assign every value to a new array as the key you want.