Search found 558 matches

by chorn
Tue Aug 14, 2018 5:03 am
Forum: mySQL & php coding
Topic: Upgrading from mysql_ to mysqli_
Replies: 4
Views: 58

Re: Upgrading from mysql_ to mysqli_

I think you can. But the class you provided doesn't seem to make use of Prepared Statements (seperating the statement from the variables to prevent SQL Injection) [just lookup those terms] - that's the major problem and implies much refactoring.
by chorn
Tue Aug 14, 2018 3:25 am
Forum: mySQL & php coding
Topic: Upgrading from mysql_ to mysqli_
Replies: 4
Views: 58

Re: Upgrading from mysql_ to mysqli_

Lookup every use of any mysql_* function, read the documentation at php.net to the according mysqli_* function, replace the old ones with the new ones, run your tests.
by chorn
Thu Aug 09, 2018 10:40 pm
Forum: PHP General
Topic: What would be the best way to encrypt and decrypt to and from a database please?
Replies: 1
Views: 46

Re: What would be the best way to encrypt and decrypt to and from a database please?

the term "best" implies at least one property on which the rating could be applied.
by chorn
Sun Aug 05, 2018 10:24 pm
Forum: mySQL & php coding
Topic: How to order a database table using Order By command
Replies: 4
Views: 78

Re: How to order a database table using Order By command

"order by" works per query, the order is not stored. So you have to apply "order by" in the query for your form.
by chorn
Sun Jul 22, 2018 9:44 pm
Forum: PHP coding => General
Topic: Sending Email problem in PHP
Replies: 1
Views: 69

Re: Sending Email problem in PHP

try a wrapper like PHPMailer that shows detailed errors.
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: 66

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

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

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

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

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

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

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

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

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

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

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

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

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

Re: Encrypt Query

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

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

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

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

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

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