Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'database'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 25 results

  1. Hi everyone, I'm building my own shopping website. I haven't figured out how to populate two dropdown lists with available sizes and colors of a product_id from database. Here is the result I've got from querying database. id product_name style size color price image sku stock 1 Neck Top 104 S White $30.00 104.jpg 104-1 5 2 Neck Top 104 S Black $30.00 104.jpg 104-2 5 3 Neck Top 104 M Red $30.00 104.j
  2. When I execute Script 12.8 (delete_entry.php) by clicking the Delete button for an entry on the view_entries.php page, the same row comes up in the Delete an Entry page, no matter from which entry the Delete button was selected. Even if I download Script 12.8 from your website and use that, the results are the same. How do I modify the delete_entry.php script to target the entry from which the Delete button was selected?
  3. So...I'm just getting really frustrated now. I've been reading through several of these chapters several times. My school always tends to not choose books well. On to the issue though. In several sections I've noted it stating "Connect to MySQL and select the forum database." This is where the issue lies. I have MySQL and PHP installed in both operating systems of my laptop (Linux and Windows) and in neither does the referenced database exist. The book does not even state WHERE or HOW to have this included. How is a person supposed to follow the examples if some crucial component
  4. Hey when I import your SQL file into my database I get this error CREATE TABLE `users` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `type` ENUM('member','admin') NOT NULL DEFAULT 'member', `username` VARCHAR(45) NOT NULL, `email` VARCHAR(80) NOT NULL, `pass` VARCHAR(255) NOT NULL, `first_name` VARCHAR(45) NOT NULL, `last_name` VARCHAR(45) NOT NULL, `date_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_expires` DATE NOT NULL, `date_modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE INDEX `username_UNIQUE` (`username` A
  5. Good to be here people. I am not being able to insert my first tasks. Is this a suprise? The error in my logs says: mysqli_fetch_array() /Applications/MAMP/htdocs/myphp/databases/add_tasks.php:64 I have really looked everywhere that I can; no joy. Can someone please help me
  6. I have an images table that has 5 foreign keys that reference 5 other tables, each of those tables uses the images table to store images, when an image gets uploaded, the foreign key in question gets a value associated with it in the images table but the other 4 foreign keys will get NULL values in that row. Is that acceptable, or should I rethink my database design? What would be the best way to go?
  7. Hi Larry, I'm looking at the customers tables design, page 188, and there is something I don't understand. For me it looks like the order_contents table can store only one item per order, with its product_id, quantity and price. But if an order contains several items, how can it be stored in the order_contents table with each product_id, quantity and price? Thank you Francois
  8. I have followed the book closely and looked over the code to make sure it matches Larry's. However, no matter what I do, I am not able to load the session into the database when I run the sessions.php file as per the book. I was hoping on some help to figure out what the issue is. I am running PHP 5.4.10 and Mysql 5.5.29. Thanks for the help in advance! ******This is my db_sessions.inc.php file:********* <?php # Script 3.1 - db_sessions.inc.php /* * This page creates the functional interface for * storing session data in a database. * This page also starts the session.
  9. 2013 was a banner year for me, I decided to focus my attention on taking my web development know-how to the next level (I happen to live in an area brimming with prospects for knowledgeable web developers). Towards that end I have spent much of my free time in 2013 reading almost everything that Larry Ullman has recently written on PHP, MySQL, JavaScript, Ajax, XML, JSON, and OOP, as well as "The Definitive Guide to HTML5" by Adam Freeman, "Beginning jQuery" by Jack Franklin, "Programming The Mobile Web," by Maximiliano Firtman and others (when, basically, Larry Ullman hadn't written anything
  10. I have a question about the database design for my project. Originally I was going to have separate tables for Managers, Owners, Players, etc... since they all require different information. This design created a problem on how to add phone numbers. In order to do this, I was going to have to create separate tables for Managers_phone, Owner_phone, Player_phone since you couldn't have a foreign key in one phone table relate to different tables. Could you just create one table for People, with all of the information that they have in common such as first name, last name, address, etc..., and
  11. in What Was Larry Thinking? #70 it is stated that "You should not index colums that: Allow NULL values" Could you please explain the reason for this?
  12. Just as a short note, the SQL commands to create the three tables for the real-world site project in chapter 15, pg. 556 caused errors in phpMyAdmin with MAMP. I removed all of the single quotation marks throughout the code and everything ran smoothly. I guess this is a phpMyAdmin issue or maybe I'm using a different version than that used in the book. Still love Mr. Ullman's books and have nearly all of them now! Thanks
  13. In one sentence: I've had a read around and if I'm not mistaken this issue is called "object relational impedance mismatch" and I would love to know a good solution to it within Yii. I'm planning to build an application that goes beyond having the typical "user", "comment", "page", "file" database where you have comparatively straight forward models for each table (like in the book). One of the problems I am trying to solve looks something like this: I have several levels of inheritance and I have no idea what the best way is to models that work with Yii. There is http://www.yi
  14. Hi Larry, When I test the DAO in your book: (page 186) $q = 'SELECT * FROM page WHERE id=1'; $cmd = Yii::app()->db->createCommand($q); $cmd->setFetchMode(PDO::FETCH_CLASS, 'Page'); $model = $cmd->queryRow(); // Use $model->title et al. I can not retrieve $model->title which is null. Also, I use $model-> attributes, the result is : Array ( [live] => 0 [id] => [user_id] => [title] => [content] => [date_updated] => [date_published] => ) Strangely, only 'live' is not null. The expected result is: Array ( [id] => 1 [user_id] => 1 [
  15. Hi Larry, and all other experts, I am following your guide on setting up yii for my site, and I am at the stage where I want to design all the database tables before I run Gii for the CRUD/model/view/controllers setups, now I wanted to save the session data onto a database table and have as little possible info in cookies (i'd rather not use cookies unless the user specifically wants to, or i may need to to validate whether the user is using the same machine). anyway, i got the session thing to work with the mysql db and it created the table fine... now i want to try to modify the tabl
  16. Barely installed Yii and already ran into trouble. I'm running Windows 7 and use Wamp and MySQL for my database. After installation, I went to the url http://localhost/myproject/index.php?r=gii and selected Model Generator. I've edited both main.php and console.php in C:\wamp\www\myproject\protected\config folder to include the following: 'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=myproject', 'emulatePrepare' => true, 'username' => 'myproject', 'password' => 'thepassword', 'charset' => 'ut
  17. I have gone into the database and explored what might happen after PayPal has been activated and is live. So I have manually changed some of the expiry dates of my users. This is my code when the registrant originally joins: $q = "INSERT INTO users (username, email, pass, first_name, mid_initial, last_name, agree, date_expires) VALUES ('" . stripslashes($u) . "', '$e', '" . get_password_hash($p) . "', '" . stripslashes($fn) . "', '" . stripslashes($mi) . "', '" . stripslashes($ln) . "', '$agree', SUBDATE(NOW(), INTERVAL 1 DAY) )"; Thus their expiry date is one day less than whe
  18. So I am looking at developing a jobsboard, which has three tables: Company - Store details of companies looking to advertise jobs, build profile. Jobs - Store details of Jobs being advertised for a certain period of time. Orders - Store details of the transactions for the jobs being posted. The way it works is the company completes registration form, then has the option of posting jobs which they will be charged a fix fee. Now what foreign key would I store in the Orders table? since I am using Paypal and don't know how much information you can carry over. Would I store the Compa
  19. I have created Rbac with superadmin,admin1,normaluser. I want to check weather the user is logged in as superadmin, admin1,normaluser depending on the database column "access" value in tbl_user table, if "access"=0 then user should be superadmin, if "access"=1 then user should be admin1 and if "access"=2 then user should be normaluser. RBAC authorization hierarchy was created by yiic shell, all the database schema has been defined. I cannot figure out how to proceed further than creating authorization hierarchy and how to write code to check a user according to roles. Here is RbacComman
  20. I have entered username and password directly in the database, now when i try to login with the data values in the default login page it shows UNKNOWN_IDENTITY error. I have printed out the error code in the log file, it shows error code is 100 which is i think is unknown identity error, the application is showing the default error which is unknown identity. Here is UserIdentity.php http://pastebin.com/emWFEwZc Here is LoginForm.php http://pastebin.com/r8WxW0CQ Here is SiteController.php http://pastebin.com/VYL3DcXV Here is login.php http://pastebin.com/0BhbhbmU
  21. A database design example commonly available pressumes that one wants to organize a collection of books, and depicts the usual author, title, isbn, etc., breakdown, and may even normalize to several tables. Generally not seen, however, is an example that includes the books contents, i.e., chapters, headings, footnotes, and body copy Any thoughs on why this is? Would MYSQL even be capable of managing the task? ~ David
  22. I am using what I have learned from the Intro to Databases chapter of the book to create a table that will hold user credentials: id, firstname, lastname, username, email, hash, timestamp are the columns. For the registration page, I want the user to submit the data firstname, lastname, username, email, and the password which will become hash. (hash being the md5($_POST['password']) string). More to the point, I want a mechanism to check whether or not the user's desired username is already taken or not. I initally went to page 361 (Retrieving Data from a Database). I found this code, thi
  23. You provide several tips for database optimization (pag 193): 1. chose the best storage engine. If I understand correctly, we basically have to chose between MyISAM and InnoDB. If it is necessary or better to use transactions we have no choice than InnoDB. If it is necessary to use FULLTEXT indexing than we have no choice than MyISAM. Other factors, as you presented, are speed - but in some other thread you said that speed depends of other factors as well, for example the OS. So I guess FULLTEXT indexing and transactions are the dealbrakers, is this correct? 2. Use the smallest datatype p
  24. Hi. I'm creating a site where users can create different "groups". We're at the point where we're designing the database, and we're not sure how to proceed to maintain security, while not compromising performance. Our current design uses one database with three tables per group: settings, members, and message board/forum. Our concern is that if this site becomes what we hope, we may have hundreds or thousands of "groups" each with three tables in the database, the database would be massive. We were also considering having one table for all groups containing the group settings and then two tab
  25. I have a MySQL database model where I have different types of users, each having common field names, like 'username', 'password', 'first_name', 'last_name', etc. etc. I've designed it so that these common fields are stored in a 'base' table called 'users' and specific fields that apply to each type of user are stored in derived 'sub-tables' for each type of user. Here is what it looks like: I know that this is a better design than having the 'common' fields stored in every 'user' table. The problem I'm having is I'm trying to figure out how I'm going insert a new user. What
×
×
  • Create New...