Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2006, 10:14 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble understing code

Here is the code that i got from "Beginning PHP5,Apache, MySQL. Web Development" book.

function get_director(){
         global $movie_director;
     global $director;

$query_d = "SELECT people_fullname FROM people WHERE people_id = '$movie_director'";

     $results_d = mysql_query($query_d)
             or die(mysql_error());
     $row_d = mysql_fetch_array($results_d);
     extract($row_d);
     $director = $people_fullname;
 }

My question are where did $people_fullname's value come from and if the value is from "extract($row_d), then how did $people_fullname get the value from "extract($row) ?

Reply With Quote
  #2 (permalink)  
Old July 13th, 2006, 01:29 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Your query statement is to get values for fieldname people_fullname from table people. The values could be an array of rows retrieve for the query statement or just one row. extract($row_d); is the same as listing of record values from your statement which in this case is only one column/field that is people_fullname.
hope this helps,
jmaronilla
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If Else Trouble Cibressus Beginning PHP 0 May 1st, 2007 02:04 PM
Please i have had a Trouble hurted Wrox Book Feedback 1 June 28th, 2004 02:18 AM
Trouble with Chapter 3 mickmo2000 BOOK: Professional Crystal Reports for VS.NET 0 February 13th, 2004 05:16 PM
trouble databass Classic ASP Databases 2 August 16th, 2003 10:27 AM



All times are GMT -4. The time now is 02:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.