Jump to content
MakeWebGames

Recommended Posts

Posted

to many different things to even list haha i have even taking querys from other things copied it and then pasted it there and edited it so it would get the info i wanted and it still keeps doing it :-|

Posted
$query=$db->query("bleh");
while ($result=$db->fetch_row($query))
{
//herp the derp
}

 

1) Have you tried adding "LIMIT 1" to the end of the query?

2) Are you only selecting one data row? If so, I think you'd want fetch_single rather than fetch_row.

Posted

I'm trying to select all of my items for a list saying what they all cost and stuff and I it selects them all but it repeats one of the items and it's not in the db more then one time

Posted

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.

 

Posted

Well I forgot to update but I went on it not to long ago to check it out and the error was gonna (scratches his head) I tried to fix it for month and just poof haha

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...