SELECT * FROM `users` WHERE 1`userid``money` i want to make the 'money' field into a variable, how can i code this? also i want it to come from a specific user which is specified by a variable in the userid field thanks dH
that code you already have is wrong, and thats SQL stuff. You'd have to make your SQL code so that it works, and then it would look somethin like userid = "1" ; then once you pulled everything from that record (because youre using a wildcard * ) then you should have a data field called money in your database. then grab it with something like $row['money'] since the wildcard will pull it into your PHP. But you have to learn PHP and SQL first.. because seeing by your code example, you're just now barely started.
right that makes sense, and im making use of the experienced programmers here im stuck and just need help lol
I am not sure what you mean from above. May be you can try something like this. <?php $uid = "1"; // Assuming we got this from session or somewhere else. $money = "10" // Assuming we get this value from $_POST or somewhere else. $query = "SELECT * FROM `users` WHERE userid = '".$uid."' AND money = '".$money."'"; $result = mysql_query($query); ?> Code (markup):