"Kamil" <oz******@tampabay.rr.com> wrote in message
news:Vv******************@tornado.tampabay.rr.com. ..
i dont know what i'm doing wrong i'm trying to get all the fields from a
specific row by user name i'm using php and i got the connection string
down and i made a query like this:
$query = mysql_query("SELECT * FROM <DBname> WHERE name = $_POST[user]");
the variable $_POST[user] was passed to the php code from a previous html
form i get the error:
Unknown column '<username here>' in 'where clause'
the <username here> part shows whatever i typed in my previous form as a
user name
i'm guessing i'm using the wrong syntax and i cant find any help on it
perhaps some one could explain this to me and point me to a site or manual
on this sort of thing. i treid php.net but they have mostly different
functions i couldnt find this one there
TIA
~ K.R
thanks for all the help i looked up all those sites an dlearned a thing or
two but it still didnt help me... i know about the risk to th server and DB
but i'm not worried, noone knows about this DB and i'm not plnin to use it
anywhere its just for my own practice. I'm still having problems but i think
i DID make some progress heres whats going on now...
what I did to test what is going on is I put my query string in an echo
satement and the literal string that comes out that is used in the query is
this:
SELECT * FROM `table` WHERE `name` = "<user>" LIMIT 1
i copied and pasted this exact string into PHPMyAdmin and replaced <user>
with a real user name in my table and it did pull the record, but now my PHP
gives this error:
Warning: Wrong parameter count for mysql_query() in <directory> on line 12
any ideas?? i'm really confused