Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'tables'.

  • 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 3 results

  1. Here are some questions that crossed my mind while reading Chapter 5 (Version 0.5) Page 86 The book states, "If you also set a requiredValue attribute for the item in question, your error message can indicate what the required value is via {value}." My question: Larry, could you please provide an example showing how the value of {value} would be set? Page 91 Please show the code I would need to "create user-related scenarios for changing passwords". Also, in which circumstances would I set a scenario on an existing instance, as opposed to creating a new user? Page 93 Why is it necessary to write "filter" twice in this code: 'filter', 'filter'=>'strip_tags' ? Page 94 Wouldn't declaring search terms as safe be a security risk? Here is the code from the book: array('id, user_id, live, title, content, date_updated, date_published', 'safe', 'on'=>'search'), Page 95 Why would we need to compare passwords if the user is only just registering? How would he/she already know a password? Quoting from the book: // Password must match the comparison: array('pass', 'compare', 'compareAttribute'=>'passCompare', 'on'=>'register'), Page 95 I have read a credible article on the Internet stating that ENUM fields are "evil". If I prefer to avoid using an ENUM field, and instead use a separate table of "types" which lists these values 'public','author','admin' etc, and the table has a one to many relationship with User.type, how would I obtain the values from the types table for use in this rule? Here is the code from the book: array('type', 'in', 'range'=>array('public','author','admin')), Page 97 The book states: "Also, when you have a model that’s not based upon a database, you’ll need to add the attribute names and values to the attributeLabels() method yourself." How do these attribute labels end up being incorporated into various HTML forms? Page 101 Quoting from the book: $this->user_id = Yii::app()->user->id; My question: I understand the relationship, but aren't there many user.id values to choose from? How does the framework know which id is the correct one? Page 102 Here's a syntax question: 'date_entered' in the first example becomes $this->created in the second example. How can these refer to the same table field? Page 102 Can you please provide an example how I could "return false in the event handler method"? Quoting from the book: "As a final note on this concept, if the event that’s about to take place shouldn’t occur–for example, the model should not be saved for some reason, just return false in the event handler method." Thanks.
  2. How can I get all the tables to appear when generating models in Chapter 4? (p 71, version 0.5) When I click the Preview button, the Model Generator shows just one table. In contrast, the book shows 5 tables. How can I get all 5 tables to appear in the Model Generator list? More info: When I open the database in the MyPhpAdmin Designer view, I can see all 5 tables -- and their relationships -- so I know they exist. (I can also see 3 other tables, all starting with "auth".) My yiicdemo files are here: D:\xampp\htdocs\yiicdemo My framework folder is here: D:\xampp\framework The Code Template dropdown shows this: default (D:\xampp\framework\gii\generators\model\templates\default) The Code File list shows only one table: models\TblUser.php Thanks.
  3. I am using the scripts in the 2nd edition and am trying to call records from the mysql dbase and arrange them into a table with three records to each row. I hope it is possible but all the suggestions I have found so far dont work. (maybe because the suggestions are for more advanced versions of php?). I can display records one row at a time (and am even using the pagination script to paginate every 6 records) however every time I try and get three records on the same row I fail. The following is from a script that is working great (used to be script 13.6 ) - but only shows one record per row. Does anyone know how this can become three records per row?..I only really need to have three images per row as this is a gallery (and each images was to act as a link to a page of its own where it could be viewed on its own as much bigger). Sorry for long-winded request. Thanks echo '<table border="0" width="94%" cellspacing="13" cellpadding="10" align="center"> <tr> </tr>'; // Display all the URLs. $result = mysql_query ($query); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { // Display each record. echo " <tr> <td rowspan=\"4\" align=\"left\"><img src=\"Uploads/{$row['image_name']}\"width=\"250\" $image[3] alt=\"{$row['print_name']}\" /></td> <td align=\"left\">Title : <font=\"Agency FB\" size=\"+1\"><b><a href=\"view_print.php?pid={$row['print_id']}\">{$row['print_name']}</a></b></font></td></tr> <tr><td align=\"left\">Description : " . stripslashes($row['description']) . "</td></tr> <tr><td align=\"left\">Price : £{$row['price']}</td></tr> <tr><td align=\"left\">Status : {$row['type']}</td> </tr>\n"; } // End of while loop. echo '</table>'; // Close the table. mysql_close(); // Close the database connection.
×
×
  • Create New...