Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Posts

    1115
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by Edward

  1. Have you seen gog.com? They have must have a database full of this kind of criteria.
  2. DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'mypassword'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'forum2'); These are contants that were defined for the values for my mysql connection. You will have to find out what yours are first before you try to connect.
  3. Okay i done a function for the drop down similar to yours hope this helps. I had to include the mysql connection inside the function otherwise $dbc was an undefined variable. DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'mypass'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'forum2'); function dropdownmenu($table, $name, $column1, $column2 ) { $dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error() ); mysqli_set_charset($dbc, 'utf8'); $q = "SELECT * FROM " . $table; $r = mysqli_query($dbc,$q); if($r) { echo "<select name=\"" . $name . ">\n"; while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo "<option value=\"{$row[$column1]}\">{$row[$column2]}</option>\n"; } echo "</select>"; } mysqli_close($dbc); } dropdownmenu('categories', 'category' , 'cat_id', 'name');
  4. This is also true for ebay, actually if you compare it to the Sony website its worse, i am always wondering if ebay are actually going to improve their look. I know enough to know that its not about the look that makes a business work, the look you could say is just the cream of the cake. That is probably a good reason why some websites fail because they focus too much on this look but forget about the overall functionality and what the users want. I would say for CSS and the User Interface, that a full time job for someone to get right, you certainly have to have the time to play around with it that us coders do not.
  5. <?php DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'mypass'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'forum2'); $dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error() ); mysqli_set_charset($dbc, 'utf8'); $q = "SELECT * FROM categories"; $r = mysqli_query($dbc,$q); if($r) { echo "<select name=\"category\">\n"; while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo "<option value=\"{$row['cat_id']}\">{$row['name']}</option>\n"; } } ?> Page Source <select name="category"> <option value="1">Larry's Books</option> <option value="2">Larry's Coffee</option> <option value="3">Larry's Pets</option> <option value="4">Larry's Cars</option> <option value="5">Larry's Houses</option> I like the background on your website, is that from Medal of Honor or Call of Duty? Okay i just made the code above for populating a drop down menu, if you check my syntax against yours that should help you with your function. I am also using the mysqli improved connection, but whichever you use it doesn't matter for this example.
  6. You would probably be fine justing scrapping the used table and adding in a column in game_products with a Boolean value. Because this is done for Male and Female although it can break the normalization rules it can be accepted
  7. More tables need to be made, you will have repeated values in columns for publishers like Microsoft and other columns. Php & MySQL for dynamic websites 4th edition covers the rules of normalization, you really need to read that over.
  8. I just check in config.inc in my phpmyadmin folder and found $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = true; I want to point out that even though i know my password is 'mypassword' that part in the config.inc file is blank,
  9. Some of those are horrible i agree, they are an eye sore to look at, but i thought the Sony website was fairly good, i think some of those comments are a little unfair, and those sites were hardly voted on by others.
  10. DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'mypassword'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'forum2'); // Make the connection: $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error() ); Here are some of my setting, i defined some constants for the values to be added to mysqli_connect function. What is your database name? Which page of the book are you working off?
  11. Ha, how can you count those characters when they are like spaghetti?
  12. You are really lucky you found Larry's book first, i am on chap 17 now. I have done a few other books but they didn't gear me up for making anything, Larry's book seems to be the only one available that can bring all you learn nicely together. Welcome to the forum.
  13. Well I would but I'm currently on the last section of your book! Another two weeks and i will be putting your code to the test, ive still got a domain and server up and running ready for it with RackSpace, the one i told you about before. I haven't done queries for a long time and i must say i had to think about that query in forum.php in the forum2 site. I know that the queries are okay if you learn them step by step, but that first query kind of went straight into the deep end. Somebody did there own report on the popularity of frameworks check this out http://www.php-devel...t-in-year-2011/ I saw Yii and codeignitor were similar in popularity. Oh, and i just bought some new games from gog.com so i have got quite a bit to do.
  14. Finally i understand your code Antonio , HTTP_USER_AGENT can be used as a good unique identifier, but as Larry was saying user IP is NOT as it can change or there can be more than one person with the same IP on the same network. PS Did you solve the Wordpress plugin/PHPBB3 problem?
  15. I was reading some of your Yii tutorials last night and i found i was able to understand more of what was going on than reading the other tutorials. I have some of the Yii books and i found them to be poorly written, it was almost like we were expected to know what was going on already, but i thought that was the reason we were buying the book to be able to read it and find out. I don't know what it is with you Larry, but you can always make good practical common sense out of complicated things which makes them easy for us to understand. I just hope will be able make the final bridge from procedural PHP into the Yii framework, so far the learning curve in your books is very smooth. Mark my words Larry, when i get my site up and running, i will be back on these forums giving you updates of every possible bug, hacking attempt etc that happens, so you can strengthen your books even more. As you can see i have slandered some of the authors of the Yii books so now i will have to make a different user name on the yiiframework forums. Its a shame you don't make more for your good work you deserve it.
  16. Edward

    Yii Ebook

    Yes possibly printing the PDF would be fine.
  17. Edward

    Yii Ebook

    yes larry we will and we will get this published. trust me on this one you dont know the real edward.
  18. Edward

    Yii Ebook

    Yes i am serious it is for a good cause to help people so yes why not!
  19. Edward

    Yii Ebook

    Okay then i can help you out, i can put money forward with you to get it printed. just tell me what you need exactly, thousands is fine by me.
  20. Edward

    Yii Ebook

    Hey Larry, how are you? I am writing this to you here as i don't want to cause you to get some unnecessary steam in a pm. I apologize i haven't been asking any questions in here recently, i am up to chap 17 of your PHP and MySQL 4th edition book. The book has been so well written it being 4th edition also that i didn't have any questions regarding any of the topics. I loved the Jquery and regular expressions chap they were very easy to follow, great stuff. After finishing this book and coffee shop in Effortless Ecommerce i will use the skills i have from these to build a basic working version of the site i would like to build for a few months, rather than learning more and forgetting stuff. One thing i want to ask you? Will your new Object Orientated Advanced book be enough to move straight onto your yii framework book and hence to use the yii framework book? Or would we have to still need to read David Powers OOP book as well. I also wanted to tell you that i absolutely hate ebooks, and seriously beg you to consider getting your yii book published as well. Advantage of your books: 1. We can work through the book at the same time as we work on our computer, without having to switch screens back and forth. (I guess this point is debable between Windows and Mac users but regardless most of us our Windows users) 2. We can put the book on our shelf for others to read, not just put it into trash as other deleted files end up. 3. We can look at the book and think, i did that one. (We can even tell our son or daughter, or family members we done that book) 4. We can put it next to all the other Larry Ullman books we have (currently 5 for me) 5. The book doesn't require a battery to work therefore if we are on a train or plane we can still read the book (some planes even tell you to turn of electrical devices) 6. Lastly books are special, i always find magic in turning the pages. Please please please Larry, i am sure there are others that will feel the same way as me about this. Please get it published.
  21. PHP cannot encode the problematic values but will encode and decode non-problematic values automatically. And because a space in the middle of a url would cause it not to work.
  22. Here is the line i used to generate the app from terminal on my mac book: Edward-Carnby-MacBook:htdocs Edward$ php yii/framework/yiic.php webapp sitename sitename is the the name of your app. What i done is i copied the yii framework folder in to the applications/mamp/htdocs folder, i renamed the yii folder yii, as before it contained info of the version number. Then i changed the file path to htdocs in terminal then run the yii command in the line above to generate the app. If you are questioning your sanity, that means your are still sane, Anders Behring Breivik is a good example of someone who is not.
  23. Just follow the installation guide on yiiframework.com, instructions are there for setting up a yii app with Mac terminal. I have made yii app's both with windows and Mac using those guides so you should be fine. If you are confused with terminal run the name in google to get terminal functions list from wikipedia.com.
  24. They have system architectural staff people to work on different parts of the site. So with any of those companies it's multiple minds not just a mark zuckerberg handling it all himself which would be impossible. A good server company will have people know how to handle the traffic like rackspace.com.
  25. Well Google and Youtube both have high traffic, Youtube being owned by Google, so what's the difference. I did figure from the beginning that you had little interest from user perspective. Most people I know don't bother with it, it's mainly for lost people. You can see already the kind of response I had when I made some social posts on this forum, nobody really cares, shows people know what they have to do here, made me realize I needed to get on also. I would like to know how it works also, ive heard of CDN where you can store country specific data related to users of that region. But first we need a site some seo and some users.
×
×
  • Create New...