Help - Search - Members - Calendar
Full Version: this is annoying me
CubeCart Forums > General > General Discussion
OskMedia
Ok i am trying to do somehtign here if someone that knows MY SQL well please let me know here is what i need i am trying to pull the ItemSKU out of there and put it on page but i can't directly pull it casue of the order number like when the order number is passed i need to some how pull the ItemSKU number with just givng the OrderNUmber so i need basically just to get the ItemSKU out of the databse with giving the OrderNumber shoudln't be hard at all my method not working if anyone knows good sql or osmehting let me know please casue this is really annoying me, -------Josh

OskMedia
i;ve been looking but if anyone knows let me know thanks
saztar
what are you talking about... ? you said like 15 different things to try to explain one thing and i dont understand what you are trying to do... are you trying to get the column out of the table... or what?

Tony~!
OskMedia
saztar whats ur MSN or instant messainign Screen name?
saztar
AIM: saztar

im not on much... but i will sign on right now to talk to you..

Tony~!
OskMedia
added buy i thoguht you would have msn since alot of cubecart buyers / whatever luike ot tlka to people an uaually uk ppl and stuff use msn, but yea i added ya
OskMedia
i imed ya tongue.gif
saztar
not on anymore..

i have msn..but dont use any im's unless someone emails me and wants me to come online... most of my stuff is dont over email... or on forums

Tony~!
OskMedia
Ok here is what i am really talking about a better explanation this image below is the Receipt table, basically where itsays ordernumber and you see 1 and then two order number 2's thats becasue both those orders are from the same order like when i made the order i had both those items in my cart and instead of combining both cart items in one cart it makes 2 different rows for every item but they both keep the same order number tongue.gif kinda snazzy, but heres my question when someone orders they go add to cart checkout(select their payemnt method enter address etc) they it redirects to either paypal stormpay or my cc merchant, and they all use ipn which sends ONE variabel back to my server, that one variable is the order number in this case i will use order number 2 for example. This is another version for my digital downloads if you didn't know just an aka. but anyways if they would jsut buy one item i could just send thje ItemSKU (prodict code) over but if someone buy more than one digital item i have to set it this way. .
So i need the PHP code to pull the ItemSKU numbers from the databse with just knowing the OrderNumber, as its being the only thing sent back to my server. If soneone thats really familiar with PHP and MYSQL let me know i have tried multiple things but can't find a good answer. So just to say it one more time in ne sentnce i need the code to pull the itemSKU number from databse with just knowing the Ordernumber. I was thinking of maybe if $OrderNumber =="ONU"
then list item sku etc etc i was thinking along the lines ofsomething like this, if you know something i would really like that, thanks ----------Josh

p.s. heres the image

iceman2g
I think what you want to do is you where clause.

i.e.

select ItemSku from tablename where OrderNumber='2'

That will pull all the ItemSku associated with that order number.



edit: I closed msn chat window, so forgive me for not responding to your im. (your not on my list)
OskMedia
so would it work if the variable passed was $ONu and how would it pull ALL itemsku's with that ordernumber i can just get it to pull the last one huh.gif -------Josh
saztar
wacko.gif

there is plenty of formus out there about SQL... should check out some of those.. they are useful... honestly i dont know what you are trying to do... but i think there are plenty easier ways to do what you are trying to do..

i could easily pull up every item on an order in a quick little code... no added columns or anything like that.

ummm.. i could be not understanding you though.

Tony~!
http://www.saztar.com/mods
OskMedia
ok i am just tryingto pull the variable ItemSKU from a specific order number as in this case order number 2 has to items so it would pull both item SKU's i need the my sql code to do that,------OskMedia
booker
Doesn't iceman's suggestion work? I would figure a simple WHERE clause would work in this case:

CODE
$query_order = "SELECT * FROM Receipts WHERE User_ID = '$User_ID' AND Date = '$Date'";
$result_order = mysql_query($query_order );
   
while($row = mysql_fetch_array($result_order ))
    {
         $ItemSKU = $row["ItemSKU"];


****whatever action you require is coded here****

    }
iceman2g
booker it does but then again. wink.gif
saztar
haha...

oh well.. cant help them all blink.gif some problems are above programming

chris.gif - eye! ..lol

Tony~!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.