Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Posts

    1115
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by Edward

  1. That's sound good. How many models did you end up with for running your website?
  2. Hey Jonathon, whats up? Are you still on target to completing your project by year end or january? I am starting to get it worked out with my project how it will work and with the code the trouble is i will have to go back and recode parts as now i am much better than when i started out. I wasn't like you, i didn't have any experience of HTML, CSS and PHP i basically just started out on Yii after reading Larry's book. However taking this root it is still working out and i reckon i am learning it all much faster than just bashing at PHP alone. Ive decided to cut down some other things now and spend at least 5 full days a week on my project, the amount of coding that needs to be done is just massive if i didn't use Yii the task would of just been impossible (thanks to the german that advised me to use a framework). The thing is with Yii I always learn something new everytime i use it. I can't put the time on when i will finish my project i really don't know because every thing looks easy but there is also much more detail that comes out of parts than i originally thought. It could be in this year, it could be 2015, or it could be early 2016. However no matter what i come across or how hard it is i will get it done. Your Friend Edward,
  3. I hope then the force will still be with you when then are all gone!
  4. I've just been checking out ebay today i see they have them going for $1000 - $5000 each. I used to have that AT - AT my Dad took it somewhere to sell with other old stuff we needed to get rid off, someone saw the Star Wars stuff and bought them all for very cheap, my we were unaware of the actual value. I am still waiting for your email... Would be interested to have a look at the Star Wars figues you have left.
  5. Thanks giving me this information now is good i have enough problems already, i will look into Cents.
  6. I hope you will get it soon. I wish i still had some vintage Star Wars action figures. Are they still sealed do they have boxes. May be if you can't sell them i would be interested to have a look at them? You can send pictures to my email.
  7. One other note since this is a decimal column the value here is now -1.00 that is for cost if its free. I hope this works out the same. Ignore this i could just set it as 0.00 for free lol how stupid of me. Anyway i got all this working now so its done. One way or another i will get it all done.
  8. Well today its time to go back, i need to fix my databases i need to take out the extra columns and go with the -1 for unlimited or free rather than holding a value for the cost. The funny thing is i did think of the -1 idea before but i didn't use it for two reason i was scared that someone's 0 quantity could become -1 which wouldn't look good on the website, the other reason was because the attribute would be using a INT SIGNED which would be bigger than INT UNSIGNED. I am laughing now because i think i could of done with a smaller integer anyway so it probably wouldn't of mattered. I was going to review this stuff when the website was complete. Anyway thanks Larry and Antonio i will go back now to make the changes to the databases where i have the problem. ISNULL i was looking at in your books is also very useful but i will try to avoid nulls in money columns and use some kind of default for safety. I don't know btw Larry if you got the Star Wars Death Star but i have some cool Christmas presents coming. I will take a picture and send you by email so you can take a look.
  9. I got the SQL query to calculate the total but this total is a little bit more complicated, i have shipping_included or free shipping which needs to be added to it. I just tried setting the shipping cost column to NULL to see what would happen and the total came out as $0.00, haha i can see this is going to be fun Now its time for some SQL conditional statements if they even exist! Oh yes page 294, 324. Just got the little statement working and it made me happy. I'll post it up! $criteria = new CDbCriteria(); $criteria->select = 'user_id, price, quantity, IF((shipping_free = \'true\'), (quantity*price), ((quantity*price) + shipping_cost)) AS total , message, shipping_service_type, shipping_included, shipping_cost, shipping_free, shipping_type, date_created'; This is an example of quality but not quantity.
  10. Thanks i like tutsplus i didn't search around as i know i can work out the total using SQL, working on the query now active record based with a cdbcriteria for now. What you mentioned looks stable if i can't find anything else i will go with that, it also has friendly classes excellent. I only have one option to get it done, so i have no choice, so it will be done. Its a shame the Yii Book isn't complete i have to depend on the Yii Definitive guide now and threads online. I am sure once that Yii ecommerce example comes out i will have to go back and probably change a lot of stuff. But this is life i am not blaming you anyway Larry i think you are already taking on more than you can handle, writing that Yii book must be extremely difficult. Even using the Yii you get better and better the more code you write so writing the book alone is incredible. Thanks once again Antonio, i will check that out once i have to deal with money using PHP.
  11. I never realized that PHP was such a disaster at calculating floating point numbers. For instance... 755 x 2 = 1.00 (Ha ha yeah??) http://www.php.net/manual/en/language.types.float.php I noticed this was something not covered in the PHP books Larry or am i once again mistaken? I have noticed from the first book i purchased from you larry Effortless E-commerce that you did your calculations in the database for totals using raw SQL. I was going to make a total column in the database because i thought it would be faster to read out the database than recalculate on loading it up but now i think ill go your way... I can seriously see with this website i am building its basically in some way should i say cocked up but to be honest its just too big for me to get right working alone. I need a team on my site, i will just have to do the best i can now and try to fix it later on with someone more professional than myself. It really seems to be impossible to get it all right first time this is my first website. I don't believe anyone can write a plan for this kind of site and follow it exactly because sometimes it just don't work the way you thought and from what i am seeing code deviates quite greatly from the actual plan. Databases need changed pages need to be recoded, its just impossible, well especially for one person, hahaha. Ah may be its not that bad, code is not like "Counting Cars" on the history channel at least we can completely recode stuff whereas like with Bob Marleys last Mercedes they can't even restore the engine as the parts are just no longer available. (What's Up Brother)
  12. I see what your saying, usually i check the value first to see what it is before adding it to a query, this was for my situations. However i am a beginner so i could be making mistakes. I will keep what you said in mind for future code.
  13. That was what i was thinking using them to help separate database tables, the good thing about Yii is we can later just change the table name that the model links to. I guess i can leave that for later on. Thanks i appreciate your reply.
  14. Its alright i finally answered my own question. Thanks
  15. Btw i don't know your email, i recently changed my email to a more personal email. I updated my email on this forum if you can email it. I did send you two messages one with the incorrect email the second with the correct email. I would appreciate it if you don't print my email on these forum threads if you have to confirm it you can check my email in your user database.
  16. Can you explain why NULL has other implications being what exactly? It matters what you say as i have many tables. Okay i will revise my databases.
  17. I mean like for your mysql tables, sorry i meant prefixes i have updated the post. tbl_orders tbl_transactions etc...
  18. Yes the constants if you are using the numbers for a class those would be fine, i actually did that in the beginning then decided to go with enum's. Enum's are very useful for debugging in the database with the precise data. Well it looks like we seem to be answering our own questions unless Larry has something to say on this matter. I though HartleySan had experience with MySQL or am i wrong, may be just PHP and JS.
  19. I was just wondering does anyone like to use table prefixes and why? Most of Larry's book don't have them sorry Larry but i didn't see them. I have a website with increasing database tables and would like to start using abbreviations now if are necessary. I would appreciate any answers to this question.
  20. I thought of using integers when i started off but when you are testing it would be hard to remember what all the numbers ment especially with my website its hard to know even where I am now. I'll probably keep enums and change them in restructuring if it every so happens as it helps me to find the bugs considering i have over 30 databases now. So its seems an extra column seems like the way to go? You could also use an unsigned column for stock quantity but if some had a 0 quantity and somehow it ended up at -1 (your unlimited quantity number) then we would have problems again.
  21. You know i am really not sure about this situation... I think i am going to add in an extra column for now because if something goes wrong with one column it will be more trouble to fix later as from what i can see now. If for some reason one column is the way to go with a NULL value for unlimited stock then i will change it. quantity ENUM('limited','unlimited'); quantity INT UNSIGNED Larry any suggestions on this situation? What is the right thing to do? I have the same situation with shippings either having a cost or being free.
  22. Yeah that's a good point i didn't think of that, this is the thing i guess you have to get things up and running and see what kind of bugs come into play and rebuild version 2. I'll have a rethink on this one! I am building another website similar to ebay there are are quite a few of these now, they are becoming more like different banks or grocery stores. Well i know i won't be able to win ebay, i just want to get my foot in the door and do my own thing, some things will differ but to be honest what goes on will be quite much the same. You know this website i can't finish i just have to get it to a level where it can go online. Its really becoming a lot more work than i expected, i have had to change databases, go back and recode parts of the site. I mean my code has even got better the way i am thinking, i am using Yii now more than i was to begin with. Its really all a learning process for me i am learning something new every day as i guess we all are. I remember when you told me before don't worry about swear words you can do that stuff later, well i know what you mean now, its better just to get the overall website built, then brush up on those small things later on, that's what i am doing more now. I am working on a tough part now, i had to plan the database 3 times before i got it right, and recode 3 times, it looked easy but later i found reasons why i couldn't do what i wanted to do. Another thing i used quite a big extension for Yii, well later on i decided to pull this out completely as it was no longer maintained and something better came along, so i had to spend about 2 weeks going through the whole site changing the code. Seriously if there is another extension like that again, i will really think if its a good idea or not to use it. Well i seem to be on the right tracks now, so there is an update if you want to know how i have been.
  23. Thanks for getting back to me on that, yes i think Null will do fine then i am consistently checking for null values in many of my situations through the website so its something i am used to working with now. Its just seems to me a waste of time to make another database column when you have have one column do all the work. Thanks for your help Antonio.
  24. I want to ask a question, say you needed to store a quantity of an item on your website 0 to 100 for example. But you could mark that this item as always in stock. Would it be a viable solution to set the quantity column in your MySQL database to NULL if you wanted to mark that something was always in stock. Or should we make a seperate ENUM column to mark stock limited or unlimited, so you would then require two columns. I have already had many situations where null values were appropriate so how about this one?
×
×
  • Create New...