ok currently I have a query set up to pull one row from a table like this. querymeres is a function that does a mysqli query and returns the result.
$query2 = "select * from gallery where id='".$id."'";
$result2 = querymeres($query2);
$row2 =$result2->fetch_object();
so at this point assuming I have a result that is an object I echo $row->name, $row->id etc to output the contents of the row.
If I understand correctly converting this to a prepared statement would go something like this:
#prepare statement
if ($query2 = $mysqli->prepare("select * from gallery where id=?")) {
/* bind parameters for markers */
$query2->bind_param("s", $id);
/* execute query */
$query2->execute();
And that is sort of where I get lost.
So this means I need to enable execute permissions on the db right?
How do I get an object that I can access with $row->item or is that not possible? And if not how do I go about getting the info out of my row? Do I have to address every single column that I want by name and assign it to something cryptic?
Also How is this anymore secure than the current way? I basically don't see what it is doing and the documentation isn't very clear to me at least.
Thanks in advance.