Jump to content

this is annoying me


Guest OskMedia

Recommended Posts

Guest 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

sql.JPG

Link to comment
Share on other sites

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~!

Link to comment
Share on other sites

Guest 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

Link to comment
Share on other sites

Guest 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 :rolly: 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

sql2.JPG

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

Guest 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 :rolly: -------Josh

Link to comment
Share on other sites

:rolly:

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

Link to comment
Share on other sites

Guest 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

Link to comment
Share on other sites

Doesn't iceman's suggestion work? I would figure a simple WHERE clause would work in this case:

$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****



     }

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