Edward
Members-
Posts
1115 -
Joined
-
Last visited
-
Days Won
27
Everything posted by Edward
-
Fixed it, Dreamweaver put a htaccess file with "deny all" in protected. + 1 point
-
I had my Yii projet files in the htdocs in a mysite folder, i decided to move the files out ot this mysite folder to the htdocs web root folder. The index page of my Yii site will load but all other pages i link to come up with the error: 404 Not Found Not FoundThe requested URL /mysite/user/create was not found on this server. Then i made the mysite folder again and put the Yii files back into it and now the same message comes up. Does anyone know why this is happening?
-
Mysql Tables Design
Edward replied to Edward's topic in MySQL: Visual QuickStart Guide (1st Edition)
I still need help with this question, waiting to here an answer before i start coding. Would appreciate the soonest response. -
Implemented the 777 and 755 today and they both work well. Now i can confirm that this post is truely authentic.
-
This is not really a book related question but more on a question of design for my tables. If i would like an expert opinion because this could be very costly for me if i was to make a design mistake and have to come back to recode later. I have a basic item table on my website which stores all item details, title, cost, quantity etc. Now each item can have more than one local shipping or international shipping. The problem i have here is that if someone had to list 100 of there products they would have to fill out these local and international shippings 100 times. So say they had 3 local shippings and 3 international shippings that would be 6 different shippings per product which would mean they would have to copy this out 600 times which seems ridiculous. So what i have done is build a shipping module which means you create one shipping module select which local and international shippings you want, then when you list your item you can pick the shipping module you want to associate with it. This would obviously be a time saver and a bit of common sense. I have is the local and international shippings which could be 3 of each per shipping module are saved to two separate databases one for local the other for domestic as both have their own individual criteria. So how should i make my databases if the local and international shipping databases would be the same for a shipping module as to an Item? There are two solutions i have now and i am wondering which is best? This is where i need your help... Solution 1 Create separate local and international shipping databases for Item and Shipping Module. For example CREATE TABLE shipping_local ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, item_id INT(10) UNSIGNED NOT NULL, cost INT(10) UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX fk_shipping_local_item_idx (item_id ASC) )ENGINE=InnoDB; CREATE TABLE shipping_international ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, item_id INT(10) UNSIGNED NOT NULL, cost INT(10) UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX fk_shipping_international_item_idx (item_id ASC) )ENGINE=InnoDB; CREATE TABLE shipping_local ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, shipping_module_id INT(10) UNSIGNED NOT NULL, cost INT(10) UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX fk_shipping_local_shipping_module_idx (shipping_module_id ASC) )ENGINE=InnoDB; CREATE TABLE shipping_international ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, shipping_module_id INT(10) UNSIGNED NOT NULL, cost INT(10) UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX fk_shipping_international_shipping_module_idx (shipping_module_id ASC) )ENGINE=InnoDB; Solution 2 Create just one of each shipping_local and shipping_international database and add both shipping_module_id and item_id to each. So if an item put the shippings in local or international shipping database item_id would have the id of the item and shipping_module_id would be set as 0 rather than Null. And if the shippings where related to a shipping module, then the shipping_module_id would have the id of the shipping module and item_id would be set to 0. For example CREATE TABLE shipping_local ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, shipping_module_id INT(10) UNSIGNED NOT NULL, item_id INT(10) UNSIGNED NOT NULL, cost INT(10) UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX fk_shipping_local_item_idx (item_id ASC), INDEX fk_shipping_local_shipping_module_idx (shipping_module_id ASC) )ENGINE=InnoDB; CREATE TABLE shipping_international ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, shipping_module_id INT(10) UNSIGNED NOT NULL, item_id INT(10) UNSIGNED NOT NULL, cost INT(10) UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX fk_shipping_international_item_idx (item_id ASC), INDEX fk_shipping_international_shipping_module_idx (shipping_module_id ASC) )ENGINE=InnoDB; I know this is a long post but i really need to ask this, i have already made some major mistakes on my projects and they can take up to 6 weeks to repair or longer depending on what it is. Edward.
-
Good to see new people joining up!
-
Foreach Loop
Edward replied to Edward's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
Its okay i have this worked out, so there no need to reply to this post. -
Hi boulbidou, this is a great form to be part of it, lots of info and experienced users are here.
-
I have a question for those with more experience than me. How does a foreach loop work if you have items in an array which are numerically indexed but in the wrong the order for example 2, 3, 1 and not 0, 1, 2. Will the foreach loop still go through each item in the order its in, or does the foreach loop sort out the values in the array first? The reason i am asking this is because i have a situation when i will need server data to be in the unordered numerical format. Your help would be much appreciated by me.
-
Normalization Is Unclear.
Edward replied to Edward's topic in MySQL: Visual QuickStart Guide (2nd Edition)
Yes that makes sense, so only if an item has more than one category we need the intermediary table. Thanks this point is clear and i can base all my other tables from this, i think i can see now why i was confused. Those examples online must of been for the other example. Thanks Hartley San. -
I have an item table: CREATE TABLE item ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, user_id INT(10) UNSIGNED NOT NULL, category_id INT(10) UNSIGNED NOT NULL, price INT(10) UNSIGNED NOT NULL, date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, date_updated DATETIME DEFAULT NULL, PRIMARY KEY (id), INDEX fk_item_user_idx (user_id ASC) )ENGINE=InnoDB; but what i don't find clear is should i make a separate table for the category_id which links to a table with all the catogories like: CREATE TABLE item_category ( item_id INT UNSIGNED NOT NULL, category_id INT UNSIGNED NOT NULL, PRIMARY KEY (item_id, category_id), INDEX fk_item_category_item_idx (item_id ASC), INDEX fk_item_category_category_idx (category_id ASC) )ENGINE=InnoDB; or should i include the category_id inside the item table. This is really not clear to me as i can find examples everywhere online of with both senerios. What is the correct thing to do have more tables or put everything in one. Because even if we have a middle table to glue the item and category table, the item_category table will still have repeated category values as would of had the item table??? I have some other tables that i need associating with the item so now, I am confused!
-
Thanks this is very helpful i will have my folder updated accordingly.
-
I am trying to get minimum 4 hours in per day when i can code. I find my brain gets tired after 1 hours work then i am done by just over 2 hours then need to come back. By the time i get to 4 hours i couldn't think well anymore and i don't seem to be producing quality work. Sometimes its just not the best way to be no stop coding as i do get most of my good ideas when i am away from the computer. Its fun but it does get quite boring at times.
-
I just have a quick question since i am no server expert. When uploading image files to a temporary folder on the server, what should we chmod the image permissions to? (e.g 777) Also what should the folder permission be of the temporary folder? I could upload my image files but could not move them to another folder on the server, is there a certain permission this folder should be also?
-
I use Dreamweaver for uploading my files, why do you use FileZila if you have DW? Jonathon can i ask how many hours per day or per week do you spend working on your website. The last few months ive done pretty much bugger all, i lost my motivation when i had to go back and recode stuff. I am forcing myself now to get through the recoding stuff will be there soon, i think if i bash out the code hard for the next 8 months i should be able to get my site online to take in some Sellers.
-
I guess we can just see how things run when our sites are up and then if we experience any security problems we can harden up on the site or server security at that point in time.
-
I tried everything else including 766 but 777 was the only thing I could get to work. The Php functions need 777 in order to operate. Well glad you could get it to work. I think if you got a VPS everything will be okay.
-
Thanks for your comments sandy. I think 777 is fine as long as you have a standard VPS this is pretty much the same as a dedicated server so in other words no one can access your files. Also you can validate any files being uploaded with chile manger just check the mimeType of the file and you can be sure what it is.
-
I just wanted to post this link to something that should matter to us...
-
Good Morning England! How are you Jonathon?
-
I found that the php functions Yii used did not work unless it was 777. Thanks for your comments 'sandy'.
-
Thanks Larry, that is what i originally coded, now i am going back to recode my item listing page and make it ajax submission only. I have also enabled csrf token on my site recently which caused me a major problem with my SWFUpload flash uploader which i landed up taking 6 hours to figure out the problem. Even though i had no form in my script it was still necessary to pass the csrf token in yii. In the end it turned out it was so easy to fix and all that for 6 hours work, i really thought i was going to have to make a post here but just after i thought that about that, that's when i got it, ahhhhhhhh! (Just one of those days, or two days rather.) Thanks for your help im still around...Just busy with my own problems now.
-
I have a website which in the future may have more than a million images on it (I HOPE SO). Images would be presented in four different sizes ranging from 100px up to 600px +. Should i save four separate images for an item so i could load the size required. (This is what i actually coded already). Or should i use the yii easyimage extension which inplements the kohana image library and enables you create each size of image you want on the fly? May be the answer to this question would be different if i had 1 million members!! I know you are a busy buy Larry but i need your advise, the things you have taught me already are considerably shortening my development time. I'm going to be there soon i can feel it.
-
I provided it in this post.
-
I've got the mail gun Yii extension up and running now it's great. It was coded by a Russian guy he made a good job of it. All the standard mail gun functions are there. It's definitly worth using this rather than standard php mail functions because all the mail will go through. It works well with Gmail, Yahoo and Hotmail and the new Hotmail Outlook. I think this is one of the best extensions for Yii.