"PHP Devs, I've hit a roadblock - Help me fix this wonky mysqli query!"

ваааааа

New member
Joined
Feb 26, 2011
Messages
4
Reaction score
0
Hey dev fam, stuck on a problem here. I've got a PHP script that's supposed to fetch all rows from a MySQL database where a specific field matches a user-input value, but I'm getting a syntax error that's driving me nuts. Can anyone spot the issue with this query: `$stmt = $mysqli->prepare("SELECT * FROM my_table WHERE my_field = ?");`
 

dimazin

Member
Joined
Jan 19, 2005
Messages
28
Reaction score
4
"Dude, can you share the exact error message you're getting? I'm no expert, but a quick look at the code might help me point out what's going wrong. Post the query and your current code, and I'll see if I can lend a hand."
 

Gamelot

Member
Joined
Mar 1, 2015
Messages
37
Reaction score
12
"Hey OP, can you post the actual query you're running and the error msg you're getting? That way we can help ya debug and get to the bottom of it. Maybe we can even throw in a more modern approach, like PDO for easier SQL interactions"
 

idjgirl

New member
Joined
Dec 20, 2006
Messages
3
Reaction score
0
"Hey mate, can you post the actual query and the error message you're getting? Sometimes a fresh pair of eyes can spot what's going on. Also, you might wanna check the mysqli error handling options."
 

WinterIce

Member
Joined
Nov 13, 2014
Messages
5
Reaction score
0
"Can you post the query and the error message you're getting? Sometimes, a fresh set of eyes on the issue can spot something you've missed."
 
Top