Welcome!

I hope you find what you're looking for. If you have any questions or anything at all, please email me at: sooj_doesnt_know@hotmail.com

Sunday, 19 September 2010

PHP Blog Week 10



This week, I actually had a minor break through. Well, I actually studied and learned how to join tables. And I remember Kirk saying that Join is awesome, and it totally is. Also I have simplified my tables. I should really say I went through the normalization process :)


Below is my ERD. It should have been submitted to moodle earlier but when I went through the noramilization I had to change a few things around and remove a few tables to simplify! it turns out I went through the process more than needed.




So my query to search for a certain pizza with a certain topping looks like this:


SELECT item_name, toppings,

TYPE FROM items

NATURAL JOIN pizza_topping

WHERE MATCH(toppings) AGAINST ("mushroom");


I still havent figured out how to pull the size and price with the pizzas but I'm gonna post on here what I have been trying and it keeps getting an error. I should be able to figure it out by today. I shall be studying the books more deeply. It really did help. I am no longer so confused and lost!


SELECT item_name, toppings, price, size

FROM items

NATURAL JOIN pizza_topping,

pizza_size_price JOIN

price, size ON price_id = price.id, size.size_id

WHERE items.id = items_id;


I'm not sure whats wrong with that but the error i get back is: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON price_id = price.id, size.size_id WHERE items.id = items_id LIMIT 0, 30' at line 5


If I fix this, I will post another one to show what I did differently. Also I did the CSS and now it looks very similar to how I wanted it on the proposal.


I cleaned up my index page and really simplified everything. I put the navigation and all the rest of the html tags along with all the includes in the header.php file. so my index page looks like:




In the header.php file, since the title of each page needs to change dynamically, this is what my title looks like. at the moment when i first visit the index page, it says $page is not set and I'm not really sure why because $page is set to home by default.. I will look into that soon.




this is just a little preview of what it looks like right now. :P I still need to fix the CSS a little to look a bit better.





Until then, Ciao!


Sunday, 5 September 2010

Blog No. 4



To be honest, I didnt do much this week. I had the flash banner due, and the HCI assignment due next week, I was pre-occupied. But I did some more work on the database design and here's what I have so far...

So i redesigned the databases after a tutorial with Kirk, and I think this is a lot better. below is what i have made so far. more tables to be made shortly!




This is just an example of what the toppings table looks like.. it contains all the pizza toppings! total of 45 of them. I was impressed to find out how many different choices of toppings you can have!



it's really really not much. but at least I'm doing something! See you next week guys.


Saying Images

Saying Images
Images with words.