Jump to content

Recommended Posts

Hi,

 

I have a two parter question completely different.

 

1. I need to have two money figures saved to my database "RRP" and "our price" and with this I would like to work out the savings. Easy enough to do, however how do I get the int number to display as £4,567.00 for example?

 

[

$savings = $row["rrp"] - $row["our_price"];

]

 

2. Part two of my question I have a database that stores cars, so models makes etc... but I also need to store colours for each car, so the colour name and the colour colour. What would be the best way of doing this? Remembering that a single car can have many many colours.

 

Any ideas and thought would be much appericated.

 

Thank you

The DECIMAL column type must be one of the options -- I've always used alter statements.

 

As for linking them together, you'll need 3 tables -- colors, cars, and the relation table.  Simply store a uid tuple in the latter.

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.