Login | Register | FAQ

Retrieve data from a database

+ Post a reply

2 posts Page 1 of 1

Retrieve data from a database

by hardboy » Mon Aug 20, 2012 6:20 am

hallow iam using this code to retrieve person data from database but every time i tried i got erorr the code:
Code: Select all
$retrive="SELECT * FROM MyTable WHERE FirstName=."$_POST["FirstName"]".";

i think i is a problem with( $_POST ) dots and double quotes so what is right code
User avatar


  • Posts: 2
  • Joined: Mon Aug 20, 2012 5:55 am

Re: Retrieve data from a database

by XainPro » Tue Aug 21, 2012 10:08 am

its correct but you can also use it like this

$retrive="SELECT * FROM MyTable WHERE FirstName= $_POST['FirstName']";

because variable name in double quotes resolves and parse from php.
User avatar


  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

+ Post a reply

Page 1 of 1