Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,585 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,968 people online right now. Registration is fast and FREE... Join Now!




mysql behaving wierd ?

 
Reply to this topicStart new topic

mysql behaving wierd ?

ghqwerty
3 Oct, 2008 - 02:04 AM
Post #1

D.I.C Regular
Group Icon

Joined: 8 Aug, 2008
Posts: 341



Thanked: 8 times
Dream Kudos: 25
My Contributions
ok so im trying to alter the code ive got so that instead of 'deleting' some thing from the records you also get some money back

at the moment im just trying to get back the total cost of the items im selecting so that i can process it and then add it to money however it doesnt seem to be working

the stats are all in a database

the most ive got to so far is it always shows 'drugs' and 10000

oh almost forgot the code

CODE
                                $qryq = mysql_query("select item from items where itemid = '".$id."'") or die(mysql_error());
                                while($qryqresult = mysql_fetch_array( $qryq )){
                                    $itema[] = $qryqresult['item'];
                                    $itemarray = implode(",", $itema);
                                    echo $itemarray;
                                $qeuryitem = mysql_query("select moneyexcellent from itemstats where item = '".$itemarray."'") or die(mysql_error());
                                    while($queryitemselect = mysql_fetch_array($qeuryitem)){
                                        $itemcost[] = $queryitemselect['moneyexcellent'];
                                        $itemstring = implode(",", $itemcost);
                                        echo $itemstring;
                                        }
                                }

User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Mysql Behaving Wierd ?
3 Oct, 2008 - 02:06 AM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,465



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(ghqwerty @ 3 Oct, 2008 - 06:04 AM) *

the most ive got to so far is it always shows 'drugs' and 10000

mysql is very fond of drugs.
User is online!Profile CardPM
+Quote Post

ghqwerty
RE: Mysql Behaving Wierd ?
3 Oct, 2008 - 02:11 AM
Post #3

D.I.C Regular
Group Icon

Joined: 8 Aug, 2008
Posts: 341



Thanked: 8 times
Dream Kudos: 25
My Contributions
lol no drugs is part of the database records

lol i bet you already new that lol haha what am i saying im bored .. no school for 3 days cos of fucked up leg .. drives you insane im nearly as bad as gabehabe
User is offlineProfile CardPM
+Quote Post

pemcconnell
RE: Mysql Behaving Wierd ?
3 Oct, 2008 - 05:10 AM
Post #4

D.I.C Regular
Group Icon

Joined: 5 Aug, 2008
Posts: 396



Thanked: 37 times
Dream Kudos: 75
My Contributions
alright matey, hows it goin?

Don't have time to go trhough it all at the mo, but at a quick glance it looks like you need to look up SUM() (MySQL) which will get you your total price.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:51AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month