How can I use a variable in a MySQL select statement?
Code:
$serverid = $_SESSION['server_id'];
$sql = "SELECT * FROM servers WHERE server_id = '$serverid'";
ThePMTeam 0 Newbie Poster
Recommended Answers
Jump to PostWhile I'd use priors like https://www.google.com/search?q=use+a+variable+in+a+MySQL+select+statement%3F&ie=utf-8&oe=utf-8 you also need to tell what language you are coding this in.
All 3 Replies
rproffitt 2,701 https://5calls.org Moderator
AleMonteiro 238 Can I pick my title?
FarrisFahad 103 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.