Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'query'.

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

  1. I'm not sure how the second part of this example is related to the first, and where it belongs. I am quoting from page 174 of YiiBook2: # models/Page.php public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); } This means you can fetch every page with every page author in one step: $pages = Page::find()->with('user')->all(); I'm guessing that with('user') calls the getUser method. Is that right? But in which file does the second part of the example belong? In the view file?
  2. I am new to using PHP and MySQL. Previously used MS Access. One ability in creating a query in Access was very helpful to me. I am asking if something like it is available in PHP-MySQL. Here is a query designed for use in MS Access: ------------ SELECT tblCourses.[ClassID], tblCourses.[Coursename], tblCourses.[TeaLastname], tblCourses.[TeaFirstname] FROM tblCourses WHERE (((tblCourses.[TeaLastname])=[Enter teacher's last name:])); ------------ This query allowed the user of the query to input a teacher's last name and then receive all the data for the courses taught by that teacher. Can anyone tell me how to accomplish this using PHP and MySQL? I would appreciate any guidance or assistance. Thank you. Wes Smith
  3. My brain must be dead, because while I read the book, I am having trouble devising a solution to this problem. I would like to include a button on a page of query results that allows users to filter the results to those that match only certain criteria. I realize that it's not a good idea to run a whole new query just for this filtering, so I have been trying to look for a solution, but to no avail. Any tips? I'm sorry for being vague, I'd just rather not give away too much about the site's structure. Thank you!
  4. Version 0.5 Page 167 Quote: "// Works safely: $model = Page::model()->find('id=:id', array(':id'=>$id));" Larry, What exactly does the colon do? What does the array do? I know they make the query safer, but how? Thanks.
  5. On line 33 it reads: $words = FALSE; // Flag variable - Why is this needed? Why false boolean? On line 37 it reads: $r = msyqli_query($dbc, $q); if (mysqli_num_rows($r) == 1) { $words = mysqli_fetch_array($r, MYSQLI_ASSOC); } - Is this common practice, to check to see if there is at least one result returned from the query? In some scripts, this is included and then in some it is. For example go to line 47 of the same script, when the array is fetched the function isn't wrapped in the same way as above. Line 46, 47: $r = msyqli_query($dbc, $q); $r = mysqli_fetch_array($r, MYSQLI_ASSOC);
  6. Should we sanitize it or the db will handle it? $q = 'SELECT subject, body FROM messages WHERE MATCH(body, subject) AGAINST('<IMG SRC="javascript:alert('XSS');">')'; Can you please put it in an working example?
×
×
  • Create New...