3 Replies - 786 Views - Last Post: 21 April 2013 - 08:22 AM Rate Topic: -----

#1 msz_900  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 35
  • Joined: 09-February 11

pdo validation inputs

Posted 20 April 2013 - 11:31 PM

can any give me the idea of how to validate the data in php using pdo...
in mysql it is simple like..
if(empty($user)||empty($pass))
{
 echo"must fill all the field";
}


how can i do it in pdo..
also how can i found that the user already exists.
Is This A Good Question/Topic? 0
  • +

Replies To: pdo validation inputs

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,333
  • Joined: 08-June 10

Re: pdo validation inputs

Posted 20 April 2013 - 11:35 PM

View Postmsz_900, on 21 April 2013 - 08:31 AM, said:

can any give me the idea of how to validate the data in php using pdo...

you donít. PDO is responsible for database interaction, general data validation can be done by means of the filter functions.

View Postmsz_900, on 21 April 2013 - 08:31 AM, said:

in mysql it is simple like..

thatís not mysql, thatís plain PHP.
Was This Post Helpful? 0
  • +
  • -

#3 msz_900  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 35
  • Joined: 09-February 11

Re: pdo validation inputs

Posted 21 April 2013 - 07:29 AM

Quote

that’s not mysql, that’s plain PHP.

did you mean that whatever we use in plain php with mysql interaction we might also use it with pdo interaction?

This post has been edited by Dormilich: 21 April 2013 - 01:26 PM

Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3034
  • Posts: 10,587
  • Joined: 08-August 08

Re: pdo validation inputs

Posted 21 April 2013 - 08:22 AM

You are not making sense.

MySQL is a separate language from PHP. PDO is a secure way for PHP to interact with MySQL. Your code in post #1 is pure PHP. You have no MySQL, no use of PDO, and very little validation.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1