Jump to content
MakeWebGames

[pdo/lite] fetch_row


WarMad

Recommended Posts

Clearly explaining problems in not one of your finest talents.

In order for people to help you - both now and in the future, it really does help if you provide a *lot* of information. Start with the basics.

McCodes engine - we know (or assume we know given the forum ...) that's a good start however if memory serves me, McCodes never had a PDO database class, only a MySQL and MySQLi class, therefore you are already presenting a problem in code that is not "out of the box".

PDO in general is nice and simple:

 

$stmt = $db->prepare("SELECT field1, field2, field3 FROM table WHERE fieldN = :expr");
$stmt->execute(['expr' => "search-expression"]);
$row = $stmt->fetch();

 

No at all complex, and reasonable safe from a number of potential attack vectors.

Now if you presented the code *you* use, then other people might be able to spot where the error lies - as it stands, we haven't a clue.

You say you've tried too many different things to list - no, I suspect that is laziness. Even Guest will have the decency to actually point people to the code he's having problems with (which happens surprisingly frequently) - so please give us a better bit of information.

I can assure you that your code is not special, no matter what you think - people have been modifying the venerable McCodes platform for years now, there's seldom anything new or indeed complex, so show us the snippet of code that you think is failing, show us the input variables ($_GET / $_POST etc) to it, show us the output and show us what the expected output should be. I'd also suggest that unless you are using 100% stock McCodes tables, you present the data definition (SHOW CREATE TABLE xxx) of the relevant tables.

Remember, asking questions is about solving problems - if you can't present sufficient information for people to address the problem - the problem doesn't go away.

*If*, on the off-chance that you have actually solved this, then I'd suggest that you actually present the problem *and* the solution so that anybody else struggling with a similar issue can learn from your experiences rather than find yet another useless topic on MWG.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...