Jump to content

kirk112

Members
  • Posts

    98
  • Joined

  • Last visited

About kirk112

  • Birthday 10/30/1983

Profile Information

  • Gender
    Not Telling
  • Location
    England

kirk112's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, Just seeing if there is a function or similar that I can use to format currency for styling purposes. All our products are stored in the decimal format in the database and can format them to the correct local, but for the design of the site I need to modify the display price if there is a pence value, so that the .99p has its own class. For example £120 I can display that correct with no decimal points etc but if the price is £79.99 I would want to break after the decimal point and add in tags for presentation display £79.<small>99</small> I have a function that explodes at the decimal point etc but was wondering if there is a simpler way to achieve this, as when the currency is EURO they have the decimal point at the thousand separator... Thanks
  2. Thanks Maxxd, mmm that makes sense the deal ID could be a unique token / guid almost impossible to stumble across by accident. Was way over thinking this Cheers
  3. Hi, Just looking for some advice over a feature I am currently working on. I am building on top of a custom e-commerce site and to increase conversions etc. I want to be able to send a URL to customers that is encoded with their details so that I can identify them when they arrive on the site. For example customer_id=1&offer_id=50&sale_products=1,2,3,4&promoted_product=12&agent=99 From this query string I can query the database and get: the customer details from their id which special offer to display i.e. 20% of products Which products are on sale for them promoted product to display on the landing page who the referrer / agent was so we can show the partner logo I could use some 2 way encryption to encrypt / decrypt this and then I would be able to use the parameters and variables, but I would have to split then and check which were there. Not all the vars are required. But got a bad feeling over this (don't know why, it just does not feel right... and that there is a better way to do this....) Can anyone see if this is a good way to achieve this or think of a better way... Thanks
  4. Thanks for the reply, They all have a article_content_id, and if I select an article from report, article, event or viewpoint I will be able to join the article content and other related information, but if I do a search on the article_content table I will not know which table to join to it as it can be 1 of 4 Regards
  5. Hi I am trying to design an article website and have got a mental block over the best way to design the database, I have attached a screenshot of the current design (please ignore the column types), I will try to best explain the problem below, please let me know if you need any additional information An article can be in any number of categories (article_to_category table) all the articles have set values which are stored in the article_content. Depending on the type of the article it can have additional attributes which are stored in the report, article, event, viewpoint tables. The problem is there is not direct link between the article_content table and the attributes in the above tables, I would have to union all the tables together and workout which of the values I need to display. I have looked at a EAV model and feel it's not the correct way to go. I have thought about combining the report, article, event, viewpoint tables into the article_content and making the column NULL but this feels 'wrong'. Thanks for your advice, please let me know if you need any further explanation [attachment deleted by admin]
  6. You do need the array, after if($_POST['Submit']) { echo"submit button detected"; echo '<pre>'; print_r($_POST); echo '</pre>'; echo '<pre>'; print_r($idarray); echo '</pre>'; and output the results. Does CompetencyGUID contain the id number of each question?
  7. If you change $idarray[]=$row2[CompetencyGUID]; to $idarray=$row2[CompetencyGUID]; Then you sql will look like UPDATE DATA SET COMPETENCYLEVEL = '4' WHERE COMPETENCYGUID = '1' AND STUDENGUID = '32A0EF05-EECB-4E5A-A4D0-F0ED1EFD35F6' Currently $idarray is being define as an array
  8. Hi if you echo '<pre>'; print_r($idarray); echo '</pre>'; What output do you get
  9. Hi Not sure if I am on the right track here but what I am trying to do is set a variable in the parent class and for this to be accessible in the child. class layout { public $site_id; function __construct($site_id) { $this->site_id = $site_id; } function get_flags() { return new flags($this); } function top_nav() { return new top_nav($this); } } class top_nav extends layout { function __construct(){ } function display_site_id() { echo $this->site_id; } } class flags extends layout { function __construct(){ } function display_site_id() { echo $this->site_id; } } $site_id = 1; $layout = new layout($site_id); $flags = $layout->get_flags(); $nav = $layout->top_nav(); var_dump($layout); var_dump($flags); var_dump($nav); This gives me the following output object(layout)#1 (1) { ["site_id"]=> int(1) } object(flags)#2 (1) { ["site_id"]=> NULL } object(top_nav)#3 (1) { ["site_id"]=> NULL } Where I would have expected object(layout)#1 (1) { ["site_id"]=> int(1) } object(flags)#2 (1) { ["site_id"]=> int(1) } object(top_nav)#3 (1) { ["site_id"]=> int(1) } but I am new to OOP and might be doing things completely wrong Thanks for your help Regards
  10. ??? ??? ??? ??? Kind of understand could be useful if you could supply some code Just a bit more information not sure if you think it always changes on the 3rd (or if I have misunderstood what you have put) 3rd - 16th Feb Menu 1 17th - 2nd March Menu 2 3rd March - 16th March Menu 1 17th March -30th March Menu 2 31st March - 13th March Menu 1 Thanks for your help - the more I try to work this out the more confused I get!
  11. Hi aschk Thanks for your reply, was hoping that there might be a logical way of performing the calculation i.e. 64 days has past from point A so that means display menu 1 (know that this is way off <--) Not looking for someone to provide the full script just a bit of logic of how this can be done Thanks agains!!
  12. Hi Can't seem to get my head around how to achieve this I need to be able to switch between a restaurant menu based on the date. Currently they are on menu one which is active from the 3rd Feb to 16th Feb and then changes to menu two on the 16th Feb to 2nd March and back to menu one on the 3rd and so on. Is they any way I can achieve this with out hard coding all possible dates for the next 3 years? Hope the above makes sense Thanks for your help!
  13. Hi, I have the following query, which when I test in phpmyadmin it returns the correct results, but when I use it in the script I get " Unknown column 'score' in 'order clause' " . Really confusing if it works in phpmyadmin then I presume it should work anywhere but............. SELECT j.job_id, jt.job_title, s.salary, lg.location_name, ls.specific_name, LEFT(jat.advert_text,1000) AS advert, DATE_FORMAT(ja.added_on, '%d-%m-%Y') AS date_added , MATCH(jt.job_title,jat.advert_text) AGAINST ('j\"ood Beverage Managery\"' IN BOOLEAN MODE) AS score FROM jobs AS j LEFT JOIN job_titles AS jt ON jt.job_id = j.job_title LEFT JOIN salary AS s ON s.salary_id = j.salary LEFT JOIN location_general AS lg ON lg.location_id = j.location LEFT JOIN location_specific AS ls ON ls.specific_id = j.location_specific LEFT JOIN job_adverts AS ja ON j.job_id = ja.job_id LEFT JOIN job_adverts_text AS jat ON ja.advert_text_id = jat.advert_text_id LEFT JOIN job_adverts_content AS jac ON ja.how_to_apply_id = jac.content_id LEFT JOIN job_adverts_content AS jac1 ON jac1.content_id = ja.header_id LEFT JOIN job_adverts_content AS jac2 ON jac2.content_id = ja.how_to_apply_id LEFT JOIN job_adverts_content AS jac3 ON jac3.content_id = ja.about_us_id WHERE ja.advert_live = 1 AND MATCH(jt.job_title,jat.advert_text) AGAINST ('j\"ood Beverage Managery\"' IN BOOLEAN MODE) ORDER BY score DESC LIMIT 0, 10 Thanks for your help!
  14. kirk112

    LOAD DATA

    What is the first line then? a header? if so how can I ignore this? Thanks fenway
  15. kirk112

    LOAD DATA

    Hi I have the following query LOAD DATA INFILE 'd:/websites/dev/cm/data/cm_products20080428.php' INTO TABLE cm_products FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' ( url, category_1, category_2, category_3, manufacturer, product_code, product_name, product_description, small_image, price) which imports the data from a file but I want to ignore the first line ('\r\n' IGNORE 1 LINES ...) but as soon as I add this to the query no information is imported. I have add a sample of the imformation to be imported below "url","category 1","category 2","category 3","manufacturer","product code","product name","product description","small image","price" "www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38" "www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38" "www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38" Any ideas why it's not importing the data the I ask it to ignore the first line Thanks for your help
×
×
  • 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.