PHP Help hopefull someone can answer this I want to take an input from a text field in a form and turn that text into a $ which will then form part of a query for MySQL e.g user enters 'john' submits form to directs to php page /////in next document//// $username_POST["username"] $result2 = mysqli_query($conn, "SELECT DISTINCT * FROM users, myreviews WHERE userid ='$username';"); obviously that above doesnt work so how do you do it? cheers
I'm not entirely sure what you mean here, but: $username_POST["username"] really doesn't look right? should it not be $username = $_POST["username"]; ?
You described two different things... if you want to simply call the input do as chris says... if you want to use that input as part of a new variable name use brackets eg. $username = phil $userid = 1 ${$username.$userid} would equal $phil1